Can you please tell me how to correctly launch the program for processing incoming messages with WebSocket ? Will there be enough of such a function or is it fundamentally wrong.
//класс с функцией start() public void start(WebSocketClientHandler client) { while (client.getUserSession().isOpen()) { } } //основной класс с точкой входа public static void main() public class MyClass { public static void main(String args[]) { try { final WebSocketClientHandler clientEndPoint = new WebSocketClientHandler(new URI("wss://example.com/ws")); clientEndPoint.start(clientEndPoint); } catch (InterruptedException e) { System.err.println("InterruptedException exception: " + e.getMessage()); } catch (URISyntaxException e) { System.err.println("URISyntaxException exception: " + e.getMessage()); } } }