All my processes have two sockets, one PUB and one SUB, and they all use the same multicast address and port.
For example, PUB will do this:
bind("epgm://239.192.1.1:5555")
SUB will do this:
connect("epgm://239.192.1.1:5555")
setsockopt(ZMQ_SUBSCRIBE, "", 0); //subscribe everything
PUB will then send message by calling zmq_send, and SUB will receive by calling zmq_poll and do Nonblocking zmq_recv.
It works perfectly fine when I run two processes on two different hosts. But if I run them on the same host, the send works but recv never receives anything.
I know the send works because if I have the third process run on a different host I'll receive message from both of the first two processes, while the first two processes only receive message sent by the third process.
So I wonder is this because zeromq (or openpgm) does some kind of filtering so messages sent from the socket with same host:port as receiving socket will not be passed to receiving socket?
I suspect ZeroMQ is not enabling multicast loopback, or maybe you are supposed to do it yourself somehow via the ZeroMQ API and you aren't.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With