question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ctx tries to close sockets that are not listed in ZContext anymore

See original GitHub issue

Hi,

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:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
MoeweXcommented, Sep 10, 2018

Hi, I can confirm that the issue is resolved, thanks!

0reactions
MoeweXcommented, Sep 9, 2018

Yes! Exactly that is the issue, you described it perfectly.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found