[zeromq-dev] Effect of RCVHWM on pull socket at context termination?

Pieter Hintjens ph at imatix.com
Mon Mar 10 22:47:27 CET 2014


Jonathan, I'm not entirely sure of the guarantees TCP gives when you
close a socket. It may well be that both sides need to close their TCP
sockets properly for data to be fully transferred.



On Mon, Mar 10, 2014 at 10:44 PM, Pieter Hintjens <ph at imatix.com> wrote:
> I think the man page is technically incorrect. The messages may have
> been sent to the network, yet not yet be received by the peer. And
> certainly not necessarily delivered to the application (libzmq, then).
>
> On Mon, Mar 10, 2014 at 8:00 PM, Jonathan Kamens <jkamens at quantopian.com> wrote:
>> Hi Pieter,
>>
>> Thanks for your reply. I'm still confused, though...
>>
>>
>> When you close TCP sockets, you will lose any data that hasn't yet
>> been received. There's no way to force data to be received except by
>> some kind of handshake back from the receiving application.
>>
>>
>> The documentation for zmq_term says, "For each socket within context, all
>> messages sent by the application with zmq_send() have either been physically
>> transferred to a network peer, or the socket's linger period set with the
>> ZMQ_LINGER socket option has expired." Is that correct? I.e., is it correct
>> that if data is being transmitted over a TCP socket, and ZMQ_LINGER is set
>> to -1, a context won't terminate until data sent over that socket has been
>> transmitted to the other end of it?
>>
>> If that is correct, then how can the data be lost on close if it has already
>> been physically transferred to the other end of the socket? What am I
>> missing?
>>
>> Thanks,
>>
>> Jonathan Kamens
>>
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>



More information about the zeromq-dev mailing list