Ctx tries to close sockets that are not listed in ZContext anymore
See original GitHub issueHi,
I have the problem that my code hangs when calling context.destroy()
(context is a ZContext). I made sure that the only part of ZeroMQ I access concurrently is this very ZContext.
When closing my sockets, I wait until context.getSockets()
returns an empty list before calling context.destroy()
. However, Ctx has still one pending connection, and sockets also contains one socket.
The code than finally hangs at the reveive.
So I wonder, why does context.getSockets()
return an empty list and how do I prevent the hang?
Quick note: I use the latest stable release, 0.4.3.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
jeromq: closing context fails - java - Stack Overflow
close () explicitly closes the socket, so calling ctx. ... Consequently, context.close should not be used with ZContext, while ctx.
Read more >Chapter 2 - Sockets and Patterns - ZeroMQ Guide
ZeroMQ sockets carry messages, like UDP, rather than a stream of bytes as TCP does. A ZeroMQ message is length-specified binary data. We'll...
Read more >ZMonitor (JeroMQ 0.4.3 API) - Javadoc.io
Socket events are only available for sockets connecting or bound to ipc:// ... ZMonitor(ZContext ctx, ZMQ. ... Stops the monitoring and closes the...
Read more >Socket Programming HOWTO — Python 3.11.1 documentation
I will try to clear up the mystery of what a socket is, as well as some hints on how to work with...
Read more >zeromq - Bountysource
Consider this code: try (ZContext zContext = new ZContext(); ZMQ.Socket client = zContext.createSocket(SocketType.REQ)) { client.setLinger(0); client.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I can confirm that the issue is resolved, thanks!
Yes! Exactly that is the issue, you described it perfectly.