[zeromq-dev] XREP/XREQ And Inproc . Clean Shutdown

john skaller skaller at users.sourceforge.net
Fri Mar 2 00:02:04 CET 2012

On 02/03/2012, at 3:39 AM, Ian Barber wrote:

> On Thu, Mar 1, 2012 at 3:51 PM, john skaller <skaller at users.sourceforge.net> wrote:
> A server must actually shutdown the reader, loop or poll for a read
> of EOF, then close the socket. Reading EOF on a shutdown receiver
> appears to be the only way to ensure delivery of transmitted data.
> The timeout in the polling or wait loop prevents  rogue clients from
> choking the server with open sockets.
> Worth checking with Martin, but I believe this is how it works, as of some time last year perhaps. The socket on closing gets handed off to a reaper thread to deal with.

Ah, thank you! Yes, that makes sense. I have seen mention of that
in the code.

> Mike Pearce wrote a good paper on how the shutdown is handled: http://www.zeromq.org/whitepapers:0mq-termination - it's not TCP specific, but might help clarify. 

An excellent paper! Thanks!

The termination model is quite nice actually.

john skaller
skaller at users.sourceforge.net

More information about the zeromq-dev mailing list