In the application from the main method in a separate thread, I launch the websocket server:
try { server.start(); while(true){} } catch (DeploymentException e) { e.printStackTrace(); } finally { server.stop(); }
In order for the server to "endlessly" wait for new connections, you need to prevent this thread from ending after the server starts. So far, just put an infinite while loop for this, but it is very processor-intensive. What could be the way to pause the method?