[zeromq-dev] Can I make sure that contexts are freed and handles released in a fast loop?

Kuba kubaraczkowski at gmail.com
Fri Feb 24 09:37:27 CET 2012


While creating the minimum test case I have run into a (well known???)
problem of
"Assiertion failed: Address already in use (signaler.cpp:260)"
I guess this in fact is the cause for Matlab failures and so on.

I have found previous thread about this problem (
http://lists.zeromq.org/pipermail/zeromq-dev/2011-June/012143.html ),
however I did not see a solution that would not require registry
modifications (and also, extending range of ports does not look like a
solution, more like a life-extension). I don't want to do any registry
modifications as my users would get crazy about that :)

Did anybody manage to solve the issue of windows running out of "socket
space" that results in the mentioned assertion ?


P.S. This problem (of course...) is visible only under windows... Under
linux I managed to have a looong loop without any problems.

On Thu, Feb 23, 2012 at 4:37 PM, Ian Barber <ian.barber at gmail.com> wrote:

> If you properly close sockets and term the context it will free up any
> resources - whether or not it will try and deliver remaining messages, or
> wait for how long, is controlled by the ZMQ_LINGER sockopt (this may be the
> source of your problems). It may take the kernel some time to make bound
> ports available again if you are reopening within a quick loop - there's
> nothing much that can be done at that level afaik. If you're seeing
> resource not being released at all it sounds like a bug, and I would try to
> create a minimal test case.
> Ian
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20120224/586ade03/attachment.htm>

More information about the zeromq-dev mailing list