On 12/21/2011 06:25 AM, Chuck Remes wrote: > This isn't new for 2.1. I think you are just getting lucky on that > other code. > > The problem is this line: > >> @socket = ZMQ::Context.new.socket(ZMQ::UPSTREAM) > > > You are not saving a reference to the context that you just created, > so the GC will reap it at some point. Change it to: > >> @context = ZMQ::Context.new @socket = >> @context.socket(ZMQ::UPSTREAM) > > And now all will be well with the world.
IIRC Java binding was facing this problem already. What they've done was to hold a Java reference to every socket created in the context: https://github.com/zeromq/jzmq/blob/master/src/org/zeromq/ZContext.java#L32 That prevents gc to deallocate the context while there are sockets still around. Martin _______________________________________________ zeromq-dev mailing list [email protected] http://lists.zeromq.org/mailman/listinfo/zeromq-dev
