public void stop()
	{
		synchronized( this )
		{
			status = STOPPING;
			//logger.info( "[" + ((thread == null) ? "NULL" : thread.getName()) + ":" + port + "] Stopping..." );
			
			//System.err.println( "[" + ((thread == null) ? "NULL" : thread.getName()) + ":" + port + "] called from: ...(sending to std err)" );
			//Thread.dumpStack();
		}
		
		Thread oldThread = null;
		if( selector == null )
		{
			// Selector never started, therefore thread stopped automatically
			// too...
			//logger.info( "[" + ((thread == null) ? "NULL" : thread.getName()) + ":" + port + "] Selector never started, so not stopping ANYTHING" );
		}
		else if( thread == null )
		{
			// Thread never finished starting, this is impossible if stop() was called from same thread as start()
			//logger.info( "[" + ((thread == null) ? "NULL" : thread.getName()) + ":" + port + "] Impossible situation - stop() was called BEFORE start() returned" );
			
			System.err.println( "[" + ((thread == null) ? "NULL" : thread.getName()) + ":" + port + "] (Impossible situation) was called from: ...(sending to std err)" );
			
			Thread.dumpStack();
			
			if( true )
				throw new UnsupportedOperationException( "Impossible situation; stop() was called BEFORE start() returned" );
		}
		else
		{
			oldThread = thread;
			thread = null;
			selector.wakeup();
			
			oldThread.interrupt();
			
			boolean outputMessageYet = false;
			while( oldThread.isAlive() || selector.isOpen() )
			{
				try
				{
					Thread.sleep( 10 );
				}
				catch( InterruptedException e )
				{
					
				}
				
				if( !outputMessageYet )
				{
					outputMessageYet = true;
					//logger.info( "[" + ((thread == null) ? "NULL" : thread.getName()) + ":" + port + "] Waiting for thread name = " + 
							//oldThread.getName() + " to return isAlive = false (currently: " + oldThread.isAlive() + 
							//"), and for selector = " + selector + " to return isOpen = false (currently: " + selector.isOpen() + ")" );
				}
			}
			if( outputMessageYet ) {
				//logger.info( "[" + ((thread == null) ? "NULL" : thread.getName()) + ":" + port + "] ...complete. Thread = " + 
						//oldThread.getName() + " is no longer alive, and selector = " + selector + " is no longer open" );
			}
		}
		status = STOPPED;
		
		//logger.info( "[" + ((thread == null) ? ((oldThread == null) ? "NULL" : oldThread.getName()) : thread.getName()) + ":" + port + "] Stopped." );
	}