[zeromq-dev] PUB/SUB issues with different transports

Martin Sustrik sustrik at 250bpm.com
Fri May 27 13:22:27 CEST 2011


Hi Attila,

> - does the ZMQ context any role other than giving a termination point
> for sockets created from it?

It contains all the per-process state. For example, inproc endpoint 
names are stored in the context. Meaning you can't access inproc 
endpoint in another context.

> - if I use the IPC transport with PUB/SUB and I create two PUB sockets
> with the same address (but from different contexts), I only get the
> messages from one of those in the SUB sockets. Should this setup be
> supported?

No. You can't bind two sockets to the same address.

> - if I use the INPROC transport, the connect call on the SUB socket
> fails if the PUB socket wasn't created first. Is this the expected
> behaviour? Shouldn't the SUB socket connect automatically whenever the
> PUB becomes available?

Yes, this is a longstanding problem with inproc. Unlike other 
transports, it has to be bound first, connected later on. This should be 
fixed in case you are interesed in doing work on 0MQ :)

Martin



More information about the zeromq-dev mailing list