[zeromq-dev] several binds on the same ipc

Tarek Ziadé tarek at ziade.org
Thu May 24 14:17:58 CEST 2012


I am trying to solve an issue I have with a broker that opens a zmq 
router socket and just relay calls to workers via a socket dealer.

The problem is that I don't know how to prevent a second broker to bind 
itself to the same ipc.

Consider the following scripts where I isolate the issue:

The server: http://tarek.pastebin.mozilla.org/1649175
The client: http://tarek.pastebin.mozilla.org/1649176

If I run them they happily interact. Now I can run a second server. It 
will bind the socket but won't do anything or even error out.

If I stop the first server, the client will simply lock, as it seems to 
have a sticky connection to the first server - and won't communicate
with the second server until I restart it.

As far as I understand, we can only bind() *once*, which make sense.

So my question is - shouldn't the second attempt to bind() the socket 
raise an error ? maybe this is related to the python binding ?

If not, how can I know if there's already a socket bound to the ipc ?


More information about the zeromq-dev mailing list