-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Is your feature request related to a problem? Please describe.
This library prevents the application from shutting down when the main application thread ends. The threads launched by the library are what prevent it from shutting down: if they aren't explicitly closed, the process doesn't end.
Describe the solution you'd like
Either allow the user to pass through a daemonize flag for threads spawned by the library or allow the user to supply a ThreadFactory that the library can use to spawn threads.
Describe alternatives you've considered
Using my own Thread to launch a server works fine...
Thread serverThread = new Thread(server);
serverThread.setName("WebSocket Server Thread");
serverThread.setDaemon(true);
serverThread.start();But there is no equivalent for clients...
WebSocketClient client = new Client(new URI("ws://localhost:8887"));
Thread clientThread = new Thread(client);
clientThread.setName("WebSocket Server Thread");
clientThread.setDaemon(true);
clientThread.start();
client.sendPing(); // ERRORS OUT
client.closeBlocking();
clientThread.join(5000);Additional context
N/A