public void stopListening()
	throws IOException
	{
        synchronized( generalSync ) {
			if( Thread.currentThread() == thread ) throw new IllegalStateException( NetUtil.getResourceString( "errNotInThisThread" ));

			if( isListening ) {
				isListening = false;
				if( (thread != null) && thread.isAlive() ) {
					try {
						synchronized( threadSync ) {
							sendGuardSignal();
//							guard.send( guardPacket );
							threadSync.wait( 5000 );
						}
					}
					catch( InterruptedException e2 ) {
						e2.printStackTrace();
					}
//					catch( IOException e1 ) {
//						System.err.println( "OSCReceiver.stopListening : "+e1 );
//						throw e1;
//					}
					finally {
						if( (thread != null) && thread.isAlive() ) {
							try {
								System.err.println( "OSCReceiver.stopListening : rude task killing (" + this.hashCode() + ")" );
//								ch.close();     // rude task killing
								closeChannel();
							}
							catch( IOException e3 ) {
								e3.printStackTrace();
//								System.err.println( "OSCReceiver.stopListening 2: "+e3 );
							}
						}
						thread = null;
					}
				}
			}
		}
	}