public void handleClientContainerFirstConnection() throws IOException { while (true) { WebSocket ws = socketServer.accept(); if (PLATFORM_URI.equals(ws.getRequestUri())) { LOG.info("New connection request - GET " + ws.getRequestUri()); (new PlatformManagerProxyReader(ws)).start(); } else { LOG.warn("Unsupported request - GET " + ws.getRequestUri()); silentClose(ws); } } }
private void handleConnection() throws IOException { while (true) { Command command = CommandCodec.decode(webSocket.getMessage()); webSocket.sendMessage(CommandCodec.encode(executeCommand(command))); } }
private static void silentClose(WebSocket ws) { try { ws.close(); } catch (IOException e) {; } }