mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-10-16 07:23:46 +02:00
Fix rvalue for socket::send() on EHOSTUNREACH
During introduction of EHOSTUNREACH, missing mapping between EHOSTUNREACH errno and false/0 return code for socket's send() calls was missing, throwing an exception. To be consistent with the rest of wrappers (e.g. DONTWAIT), fix it by handling this errno as a regular EAGAIN, and let the caller use errno/zmq_errno() to branch on their code.
This commit is contained in:
4
zmq.hpp
4
zmq.hpp
@@ -631,6 +631,8 @@ namespace zmq
|
||||
return (size_t) nbytes;
|
||||
if (zmq_errno () == EAGAIN)
|
||||
return 0;
|
||||
if (zmq_errno () == EHOSTUNREACH)
|
||||
return 0;
|
||||
throw error_t ();
|
||||
}
|
||||
|
||||
@@ -641,6 +643,8 @@ namespace zmq
|
||||
return true;
|
||||
if (zmq_errno () == EAGAIN)
|
||||
return false;
|
||||
if (zmq_errno () == EHOSTUNREACH)
|
||||
return false;
|
||||
throw error_t ();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user