Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZMQ_MCAST_LOOP semantics #93

Closed
jcable opened this issue Oct 3, 2010 · 7 comments
Closed

ZMQ_MCAST_LOOP semantics #93

jcable opened this issue Oct 3, 2010 · 7 comments

Comments

@jcable
Copy link

jcable commented Oct 3, 2010

Hi,
just had a play with 0MQ. Translated the Hello World example to use pgm where the client and server both use a pair of PUB/SUB sockets on the same multicast group. It works fine if the SUB sockets filter - the server filters on "H" and the client filters on "W". But I hoped that if I turned off ZMQ_MCAST_LOOP I could filter on "". But the client receives its own messages. I guess this is because the ZMQ_MCAST_LOOP applies to the socket, not to the transport. Since I'm only allowed to use PUB and SUB sockets with pgm, and PUB sockets aren't allowed to call recv, I'm not sure what the point of setting ZMQ_MCAST_LOOP on a PUB socket is. If the purpose of ZMQ_MCAST_LOOP is to set IP_MULTICAST_LOOP on the underlying dgram socket then 0MQ must be looping the messages back higher up the stack, in which case ZMQ_MCAST_LOOP is confusing - I would expect a socket option to affect the behaviour of the socket layer I send it too.

Julian

@jcable
Copy link
Author

jcable commented Oct 3, 2010

Hm ..

I tried using two separate multicast groups and I tried using two ports on the same multicast group.

Two ports on the same group gives an error:

Assertion failed: status == PGM_IO_STATUS_NORMAL (pgm_socket.cpp:490)

I guess this is to do with trying to join the group twice, but its perfectly standard to use different ports on the same group for different styles of communication (e.g. RTP and RTCP).

Using 2 groups with the same port results in message loopback. It looks like the dgram socket is only binding/connecting to the port with in_addr_any rather than binding to the group/port tuple as it should.

@jcable
Copy link
Author

jcable commented Oct 3, 2010

I also get the Assertion failed: status == PGM_IO_STATUS_NORMAL (pgm_socket.cpp:490) error with two groups on different ports:

sub_socket.connect("pgm://eth0;233.11.2.2:5556");
pub_socket.connect("pgm://eth0;233.11.2.1:5555");

@steve-o
Copy link
Contributor

steve-o commented Oct 7, 2010

Windows requires ZMQ_MCAST_LOOP on the publisher, POSIX requires it on the subscriber.

@steve-o
Copy link
Contributor

steve-o commented Oct 7, 2010

Line 490 isn't from master, the released versions of 0MQ only supported one PGM transport per process, this issue has already been resolved.

@jcable
Copy link
Author

jcable commented Oct 11, 2010

I'll try the unreleased version but I don't understand why there should be a platform dependency - arn't you designing an API with known semantics?

@steve-o
Copy link
Contributor

steve-o commented Oct 12, 2010

To be platform agnostic it means that ZMQ_MCAST_LOOP should be set on both PUB and SUB.

Note that enabling multicast loop breaks reliability so it is not recommended for production use, only for test and development.

@sustrik
Copy link
Member

sustrik commented Mar 1, 2011

Ok, no traffic for several months, i assume this issue is answered. Closing it.

drahosp pushed a commit to LuaDist/libzmq that referenced this issue Feb 13, 2014
[LIBZMQ-543] Fix compilation errors with Clang
benjdero pushed a commit to benjdero/libzmq that referenced this issue Feb 20, 2023
bluca pushed a commit that referenced this issue Oct 31, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants