[zeromq-dev] Lost message with PUSH/PULL

KIU Shueng Chuan nixchuan at gmail.com
Fri Jul 1 16:53:52 CEST 2016

I have attached some minimal code here where doing a TCP connect to
the PUSH bind socket makes the latter writable.

Tested on 4.1.4

On 30 June 2016 at 23:11, Doron Somech <somdoron at gmail.com> wrote:
> I think it might be the ZeroMQ behavior (which is probably a bug), once the
> connection is open ZeroMQ start to queue messages for the connection, even
> if handshake is not yet completed, so when you do telnet the message is not
> discarded but queue for the telnet connection.
> I think only PUSH is affected by this behavior, also fixing it might be
> hard, it also might be security issue, right now PUSH socket type is not
> safe for internet use because of this.
> If you can I suggest you reverse the bind/connection so PUSH will connect
> and PULL will bind. If not an option try to use ROUTER instead and have some
> kind of handshake.
> Nice catch, I still want to make sure that is really what happen and see if
> it possible to fix this easily..
> On Thu, Jun 30, 2016 at 11:32 AM, 王运来 <hnwyllmm at 126.com> wrote:
>> Hi every guys:
>>        I got a problem which ZMQ will lost some messages with PUSH/PULL
>> ZMQ socket.
>>        The scene like this:
>>        A: PUSH socket, bind address "tcp://*.1209"
>>        B: PULL socket, connect to "tcp://localhost:1209"
>>        Run the command "telnet localhost 1209" while A sending message to
>> B.
>>        The result is B will miss  messages even if I set the option of
>> ZMQ_IMMEDIATE to 1 like this:
>>            int immediate = 1;
>>    zmq_setsockopt(pSock, ZMQ_IMMEDIATE, &immediate, sizeof(immediate));
>>       Is it right in this scene or is it should be?
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_push_loss.cpp
Type: text/x-c++src
Size: 1178 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20160701/472ea466/attachment.cpp>

More information about the zeromq-dev mailing list