[zeromq-dev] Question about router-dealer sockets

Stuart Brandt stu at compuserve.com
Fri Nov 30 19:08:05 CET 2012

And it's not just 0MQ...it's the default behavior with TCP sockets. Take 
a look at the code for a slow server emulation: 

If you compile/run it and then pipe a bunch of data at it (e.g. 'man cat 
| telnet <servers-listen-port>') , you'll see that the client ends long 
before the server and yet the server continues to get data on its recv 
calls.  A netstat will show the server's socket in a CLOSE_WAIT state 
with a RECVQ that's decreasing ever so slowly, and the server itself 
won't detect socket close until the RECVQ empties.

On 11/30/12 12:57 PM, Andrew Hume wrote:
> chuck answered this more fully, but here is at least one good reason:
> one thing i love about 0mq is that i can start sender and receiver in 
> any order.
> and this is precisely the case where just one end is up.
> but as chuck said, read that part of the guide.
> On Nov 30, 2012, at 9:38 AM, Marco Trapanese wrote:
>> Il 30/11/2012 00:36, Michel Pelletier ha scritto:
>>> Yes.  0mq pushes messages as far to the receiver as possible as soon as
>>> possible.  Linger only effects messages that have not yet been
>>> transmitted from the senders queue.  If your message got sent to the
>>> router and it's in the routers queue, then the router will receive it,
>>> regardless of the state of the sender at that point.
>> What is the purpose of this behavior?
>> I can't imagine such an application where I want to either transmit or
>> receive something if *both* ends aren't running.
>> I have to do several workarounds in my code to get all the stuff to work.
>> Of course, if the zmq's guys decided to do this there is good reason.
>> But I can't see which one.
>> Marco
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org <mailto:zeromq-dev at lists.zeromq.org>
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> -----------------------
> Andrew Hume
> 623-551-2845 (VO and best)
> 973-236-2014 (NJ)
> andrew at research.att.com <mailto:andrew at research.att.com>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121130/bd724141/attachment.htm>

More information about the zeromq-dev mailing list