From d1373792f7888f312cd7286fdf524a0bfe124846 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 23 Jun 2011 07:57:47 +0200 Subject: Outstanding requests dropped when requester dies (issue 190) So far the requests in req/rep pattern were delivered to and processed by worker even though the original requester was dead. Thus, the worker processing replies with noone to deliver results to. This optimisation drops requests in two situations: 1. Queued inbound requests in XREP socket when peer disconnects. 2. Queued outbound requests in XREQ when socket is closed. Signed-off-by: Martin Sustrik --- src/socket_base.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/socket_base.cpp') diff --git a/src/socket_base.cpp b/src/socket_base.cpp index 804ec46..74a345b 100644 --- a/src/socket_base.cpp +++ b/src/socket_base.cpp @@ -426,7 +426,7 @@ int zmq::socket_base_t::connect (const char *addr_) object_t *parents [2] = {this, peer.socket}; pipe_t *pipes [2] = {NULL, NULL}; int hwms [2] = {sndhwm, rcvhwm}; - bool delays [2] = {true, true}; + bool delays [2] = {options.delay_on_disconnect, options.delay_on_close}; int rc = pipepair (parents, pipes, hwms, delays); errno_assert (rc == 0); @@ -462,7 +462,7 @@ int zmq::socket_base_t::connect (const char *addr_) object_t *parents [2] = {this, session}; pipe_t *pipes [2] = {NULL, NULL}; int hwms [2] = {options.sndhwm, options.rcvhwm}; - bool delays [2] = {true, true}; + bool delays [2] = {options.delay_on_disconnect, options.delay_on_close}; int rc = pipepair (parents, pipes, hwms, delays); errno_assert (rc == 0); -- cgit v1.2.3