public void doRun() {
		/* Check if any messages are waiting
		 * in the queue.
		 */
		boolean doLoop;
		synchronized( this ) {
			doLoop = waitQueue.size() > 0;
		}
		if( doLoop ) {
			while( true ) {
				Message m;
				synchronized( this ) {
					m = getMostRecentMessage();

					// See if m exists and should be delivered by now
					if( m == null || m.getReceivedTime() > ((System.currentTimeMillis( ) / 1000.0) - messageDelay) )
						break;

					// Pop the message from the queue
					waitQueue.remove(m);
				}
				notifyReceivedHandlers(m, this);
			}
		}
		synchronized( this ) {
			doLoop = sendQueue.size() > 0;
		}
		if( doLoop || true ) {
			while( true ) {
				Message m;
				synchronized( this ) { 
					m = getMostRecentSendMessage();

					// See if m exists and should be delivered by now
					if( m == null )//|| m.getSendTime() >= System.currentTimeMillis( ) / 1000.0 )
						break;

					// Pop the message from the queue
					sendQueue.remove(m);
				}
				dispatchMessage(m);
			}
		}
	}