frame.pack();
frame.setVisible(true);
}
private void startServer() {
ServerWebSocket swSocket = null;
WebSocket socket = null;
try {
InetAddress addr = InetAddress.getByName(null);
int port = 11854;
swSocket = new ServerWebSocket(port, 10, addr);
incoming.setText("Starting to listen on port: "+port);
try {
socket = swSocket.accept();
try {
handleConnection(socket);
} finally {
socket.close();
}
} catch (IOException e) {
onException(e);
} finally {
swSocket.close();
}
} catch (IOException e) {
onException(e);
}
}