From a3889d00c346bccb47b67ebf4bf3839b00b0821f Mon Sep 17 00:00:00 2001 From: Pieter Hintjens Date: Fri, 19 Oct 2012 15:09:52 +0900 Subject: [PATCH] Fixed issue #451 --- doc/zmq_setsockopt.txt | 7 ++----- src/router.cpp | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/doc/zmq_setsockopt.txt b/doc/zmq_setsockopt.txt index 2928397a..018070d0 100644 --- a/doc/zmq_setsockopt.txt +++ b/doc/zmq_setsockopt.txt @@ -371,11 +371,8 @@ ZMQ_ROUTER_MANDATORY: accept only routable messages on ROUTER sockets Sets the 'ROUTER' socket behavior when an unroutable message is encountered. A value of `0` is the default and discards the message silently when it cannot be -routed. A value of `1` returns an 'EAGAIN' error code if the message cannot be -routed. - -Note: Setting this socket option may have unpredictable effects on reactor-type -libraries that assume EAGAIN will only be sent in HWM-type situations. +routed. A value of `1` returns an 'EHOSTUNREACH' error code if the message +cannot be routed. [horizontal] Option value type:: int diff --git a/src/router.cpp b/src/router.cpp index fdba1f82..c136e607 100644 --- a/src/router.cpp +++ b/src/router.cpp @@ -162,7 +162,7 @@ int zmq::router_t::xsend (msg_t *msg_, int flags_) else if (mandatory) { more_out = false; - errno = EAGAIN; + errno = EHOSTUNREACH; return -1; } }