[zeromq-dev] several binds on the same ipc

Pierre Ynard linkfanel at yahoo.fr
Thu May 31 18:35:32 CEST 2012


Hello,

> Yes, I remember this change. Since IPC endpoints are persistent, if
> there's a crash this is the obvious way of recovering.
> 
> How to prevent two brokers binding to the same endpoint?
> 
> I'm not sure there's any solution that will give both behaviours.

A solution could be to try to connect() to the existing socket: if it is
a stray socket left by a dead process, it should return a "connection
refused" error, so you know you can delete it. There is still a race
condition between that check and the unlink() though.

Regards,

-- 
Pierre Ynard
"Une âme dans un corps, c'est comme un dessin sur une feuille de papier."



More information about the zeromq-dev mailing list