/** * Closes client connection and destroys all resources, allocated by the socket server. * * @throws IOException * if an I/O exception has occurred. */ public void stop() throws IOException { endConnection(); if (serverSocket != null) { serverSocket.close(); } } }