[zeromq-dev] [PATCH] Fix handle connection reset during session init

Thijs Terlouw thijsterlouw at gmail.com
Thu Jan 20 08:39:00 CET 2011

On Thu, Jan 20, 2011 at 1:52 PM, Thijs Terlouw <thijsterlouw at gmail.com> wrote:
> I've also tried your suggestion with ZMQ_LINGER and set ZMQ_LINGER on
> all sockets I have. Unfortunately I still have problems. It seems that
> after rebuild the zmq_socket, sometimes the zmq_poll function will not
> notify me of ZMQ_POLLIN events. The same code worked correctly with
> 2.0.10. I used tcpdump to check if the data is sent on the network to
> the 'server' and it appears to be ok. The server application code just
> doesn't receive the event from ZMQ.... so now continue debugging
> this....

my architecture looks like this:

(client] connect --- bind [proxy] bind --- connect [worker)

now it seems the ZMQ_XREP socket between the proxy and worker is not
destructed totally. When I experience problems there are two TCP
socket connections open between my server and proxy (viewed with
lsof), even though I have set ZMQ_LINGER to 0 and deleted my previous
zeromq socket and made a new socket. So it seems internally ZeroMQ
keeps both the old socket and the new socket open. When load balancing
over the two sockets occurs, the new socket works correctly, but the
old socket doesn't. When I restart my worker application, I can
correctly see 1 TCP connection again and everything works as expected.


More information about the zeromq-dev mailing list