[zeromq-dev] SUB socket hangs after some time (Joshua Foster)

Mike Perik michaelperik at yahoo.com
Thu Nov 11 05:21:28 CET 2010

You may want to look at the patch Marc Rossi submitted either yesterday or 
earlier today for the very same problem.

I'm running it on OS X with 2.0.9 and I haven't seen the issue yet. I'll  
compile 2.0.10 and see if it happens later tonight. Not sure if this  affects 
it, but numMessages should be volatile since you have multiple  threads 
accessing it. If you want the ability to restart the subscriber  without losing 
messages, be sure to set the identity. Also, are you  running both pub and 
client on the same machine with tcp://


On Nov 10, 2010, at 6:32 AM, Oliver Senn wrote:

> Hi list,
>  In our code we use a simple PUB/SUB scheme: A publisher is sending data  over 
>a PUB socket and a subscriber is getting that data using a SUB  socket.
> Today I tested the code and (especially with a lot of  messages) after some 
>time the subscriber hangs in socket.recv(). The  publisher happily goes on at 
>sending messages and does not return an  error. The subscriber does not get any 
>of those messages though and also  does not report an error.
> I simplified the code we are  using and a attached it to this email. Sometimes 
>the problem appears  after 20 seconds and sometimes after 400 but eventually it 
> I am using ZeroMQ 2.0.10 and the Java bindings on Mac OS X 10.6.4 with .
> Best,
> Oliver
> <Client.java><Publisher.java>_______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev

More information about the zeromq-dev mailing list