private void closeConnection() {
		logger.finer("Closing server connection");
		synchronized(CONNECTION_LOCK) {
			if(receivePacketThread != null)
				receivePacketThread.stopReceiving();
			if(timeoutThread != null)
				timeoutThread.stopCheckingForTimeouts();
			if(socket != null)
				socket.close();
			resetParameters();
		}
	}