[zeromq-dev] Q; running multiple REP listeners on an IPC socket, only the last one connected gets any messages

Dr Tune drtune at gmail.com
Fri Dec 17 19:44:27 CET 2010


Thanks all,
I later re-re-read the documentation and realised I was misunderstanding
ZMQ;  - you can't bind multiple listen sockets to the same physical address
with any protocol (by design) and there is Another Way To Do It.

This re-binding failure is masked with IPC sockets (only last bind works) as
you point out; but hey, user-error.

Thanks!
DrTune.


On Fri, Dec 17, 2010 at 9:16 AM, Dhammika Pathirana <dhammika at gmail.com>wrote:

> Martin,
>
> On Fri, Dec 17, 2010 at 3:31 AM, Martin Sustrik <sustrik at 250bpm.com>
> wrote:
> > Hi,
> >
> >> 1) Using one zmq context, I bind four separate zmq sockets (in java) to
> >> the same ipc port; e.g. "ipc://tmp/test"
> >
> > Hm, you should be able to bind at most one socket to a particular
> > endpoint. Are you sure all the four binds succeed?
> >
>
>
> All four binds will succeed, as we unlink() before we call bind().
> This is a bug and comments here are misleading.
>
> 217     else if (strcmp (protocol_, "ipc") == 0) {
> 218
> 219         //  Get rid of the file associated with the UNIX domain socket
> that
> 220         //  may have been left behind by the previous run of the
> application.
> 221         ::unlink (addr_);
> 222
>
>
> Dhammika
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20101217/6c8cd4f3/attachment.htm>


More information about the zeromq-dev mailing list