[zeromq-dev] is this a linux bug?

Martin Sustrik sustrik at 250bpm.com
Mon Jan 10 17:28:41 CET 2011


> one of the things i like about zeromq is that you don't
> have to be fussy about the order of starting things up.
> for example,
> proc a:
> sock = zmq_socket(ctxt, ZMQ_PUB)
> zmq_bind(sock, "tcp://*.34567")
> and proc b:
> sock = zmq_socket(ctxt, ZMQ_SUB)
> zmq_connect(sock, "tcp://myhost.34567")
> works just fine, no matter the order they start in.
> (they're both running on the same host.)
> however, if proc a dies, and we start another one,
> it can't, becaus ethe bind fails because of "Address already in use".
> (i observe that if we have run proc b on another host,
> we never get this error.)
> is this a zmq issue, or yet another case where linux is screwing us?

IIRC, if the process bound to a particular port dies, it takes kernel 
some time to make the port usable again.

I am not a really a Linux internals expert though.


More information about the zeromq-dev mailing list