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, 王运来 <[email protected]> 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 > [email protected] > http://lists.zeromq.org/mailman/listinfo/zeromq-dev >
_______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
