private void timeOut() {
		boolean timedOutBeforeConnecting = false;
		boolean timedOutAfterConnecting = false;
		synchronized(CONNECTION_LOCK) {
			if(isAttemptingToConnect) {
				logger.fine("Connection to " + serverAddress + ":" + serverPort + " timed out");
				closeConnection();
				timedOutBeforeConnecting = true;
			}
			else if(isConnected) {
				logger.fine("Connect request to " + serverAddress + ":" + serverPort + " timed out");
				disconnectQuietly();
				timedOutAfterConnecting = true;
			}
			//it should be impossible for timedOut() to get called if the
			// ClientConnection is neither connected nor attempting to connect,
			// but we'll check for both separately and not assume anything
		}

		//once again, exactly one of these could be true, but we're making sure
		// both don't get run and not assuming one not happening implies the
		// other happening=
		if(timedOutBeforeConnecting) {
			onCouldNotConnect(ClientConnection.CONNECT_REQUEST_TIMED_OUT);
		}
		else if(timedOutAfterConnecting) {
			onDisconnected(ClientConnection.CONNECTION_TIMED_OUT);
		}
	}