private long checkClientTimeouts(int timeout) {
		//we may need to notify the listener of disconnected clients
		Set<Integer> disconnectedClientIds = new HashSet<Integer>();
		long oldestClientCommunicationTime = -1;

		synchronized(CONNECTION_LOCK) {
			//if the server isn't running just return a sentinel value
			if(!isRunning)
				return -1;

			//check to see if any client has timed out
			long now = System.currentTimeMillis();
			oldestClientCommunicationTime = now; //now is a good default value as it will make the timeout thread wait the full timeout if no clients are connected
			for(Iterator<Integer> iter = clients.keySet().iterator(); iter.hasNext();) {
				int clientId = iter.next();
				ClientInfo client = clients.get(clientId);

				//if the client has timed out then remove it from the list of clients
				if(client.getTimeOfLastCommunication() + timeout <= now) {
					iter.remove(); //removing client ids from the key set DOES remove clients from the map
					disconnectedClientIds.add(clientId); 
				}

				//otherwise this client may be the client closest to timing out
				else if(client.getTimeOfLastCommunication() < oldestClientCommunicationTime)
					oldestClientCommunicationTime = client.getTimeOfLastCommunication();
			}
		}

		//inform the listener of any clients that timed out
		for(int clientId : disconnectedClientIds) {
			logger.fine("Client " + clientId + " timed out");
			onClientDisconnected(clientId, Server.CLIENT_TIMED_OUT);
		}

		//return the time of last communication of the client who is closest to timing out
		return oldestClientCommunicationTime;
	}