[zeromq-dev] SUB and PUB sockets on one url over epgm/pgm
Sergey Zinov
s.zinov at emw.hs-anhalt.de
Mon May 11 15:53:35 CEST 2015
Hi all,
I encountered problem, while using zeromq with epgm transport.
I have several nodes that should broadcast messages to each other, for
that purpose each node creates two sockets(one PUB and one SUB) with
same url. See attachment for sample code(python).
First I tested it on amd64 linux server, and it worked as I expected.
Each nodes can send and receive messages.
But then I tried it on ARM board, and it worked only
occasionally(something like 1 of 10 runs). I also tried to run it on
virtual machines, and sometimes observe such misbehavior there(but it
works most of the time). So it seems there is some connection between
performance of machine and this bug.
After some days of tries, I found out, that if I do
'setsockopt(zmq.SUBSCRIBE, "")' for subscriber socket before I bind
publisher socket, it works, otherwise described behavior is observed.
With this 'fix' it seems to be working fine. But definitely something is
wrong here, and I'm not sure how robust this solution is. I'm not really
sure if it is a bug in zeromq at all - maybe I'm trying to use zmq wrong
way. Can anybody tell if there is better solution for my case?
Best regards,
Sergey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zmq_two_sockets_test_case.py
Type: text/x-python
Size: 1126 bytes
Desc: not available
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20150511/d8364443/attachment.py>
More information about the zeromq-dev
mailing list