public void run() {
			String theMsg = null;
			ITupleSpaceConnectorListener theListener = null;
			while (isRunning) {
				synchronized(messages) {
					if (messages.isEmpty()) {
						theMsg = null;
						theListener = null;
						try {
							messages.wait();
						} catch (Exception e) {}
					} else if (isRunning && !messages.isEmpty()) {
						theMsg = messages.remove(0);
						theListener = listeners.remove(0);
//						System.out.println("XXX "+theMsg+" "+theListener);
					}
				}
				if (isRunning && theMsg != null) {
					sendMessage(theMsg,theListener);
					theMsg = null;
					theListener = null;
				}
			}
			
		}