Skip to content

Commit 5363388

Browse files
committed
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.
1 parent b544d86 commit 5363388

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

zmq.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,8 @@ namespace zmq
631631
return (size_t) nbytes;
632632
if (zmq_errno () == EAGAIN)
633633
return 0;
634+
if (zmq_errno () == EHOSTUNREACH)
635+
return 0;
634636
throw error_t ();
635637
}
636638

@@ -641,6 +643,8 @@ namespace zmq
641643
return true;
642644
if (zmq_errno () == EAGAIN)
643645
return false;
646+
if (zmq_errno () == EHOSTUNREACH)
647+
return false;
644648
throw error_t ();
645649
}
646650

0 commit comments

Comments
 (0)