mirror of
https://github.com/zeromq/cppzmq.git
synced 2025-01-19 00:46:05 +01: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:
parent
b544d86c5f
commit
5363388fc5
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 ();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user