Skip to content

Commit

Permalink
Fix rvalue for scocket::send() on EHOSTUNREACH
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
msune committed Jun 7, 2017
1 parent b544d86 commit a71e476
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions zmq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
}

Expand All @@ -641,6 +643,8 @@ namespace zmq
return true;
if (zmq_errno () == EAGAIN)
return false;
if (zmq_errno () == EHOSTUNREACH)
return false;
throw error_t ();
}

Expand Down

0 comments on commit a71e476

Please sign in to comment.