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:
Marc Sune 2017-06-07 11:56:27 +02:00
parent b544d86c5f
commit 5363388fc5

View File

@ -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 ();
}