public void shutdown() { HttpProxyCacheDebuger.printfLog("Shutdown proxy server"); shutdownClients(); config.sourceInfoStorage.release(); waitConnectionThread.interrupt(); try { if (!serverSocket.isClosed()) { serverSocket.close(); } } catch (IOException e) { onError(new ProxyCacheException("Error shutting down proxy server", e)); } }