We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I haven't found a way of shutting down a UnixServerSocket that's waiting for incoming sockets in accept(). It also doesn't respond thread interrupts?
The code looks a little like this - and the accept still hangs after the interupt.
Thread thread = new Thread(() -> { UnixSocketAddress socketAddress = new UnixSocketAddress("/tmp/file.sock"); UnixServerSocket serverSocket = new UnixServerSocket(); serverSocket.bind(socketAddress); while (true) { UnixSocket sock = null; try { sock = serverSocket.accept(); // ... do stuff } catch (Exception e) { if (sock != null) { sock.close(); } } System.out.println("I surrender"); } }); thread.start(); Thread.sleep(2000); thread.interrupt(); Thread.sleep(10000);
The text was updated successfully, but these errors were encountered:
I think this is a duplicate of #21. I proposed a fix in #25, but that is now stale and needs to be freshened up to be ready for a merge.
Sorry, something went wrong.
No branches or pull requests
I haven't found a way of shutting down a UnixServerSocket that's waiting for incoming sockets in accept(). It also doesn't respond thread interrupts?
The code looks a little like this - and the accept still hangs after the interupt.
The text was updated successfully, but these errors were encountered: