Fixed a case where an exception would kill the kernel

adapter thread.  Also improved the details of the error
logging.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7255 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
PSp..om 14 years ago
parent bfd49c43e3
commit 5225599ee2
  1. 17
      engine/src/networking/com/jme3/network/base/KernelAdapter.java

@ -93,12 +93,12 @@ public class KernelAdapter extends Thread
kernel.terminate();
}
protected void reportError( Exception e )
protected void reportError( Endpoint p, Object context, Exception e )
{
// Should really be queued up so the outer thread can
// retrieve them. For now we'll just log it. FIXME
log.log( Level.SEVERE, "Unhandled error", e );
}
log.log( Level.SEVERE, "Unhandled error, endpoint:" + p + ", context:" + context, e );
}
protected HostedConnection getConnection( Endpoint p )
{
@ -148,7 +148,7 @@ public class KernelAdapter extends Thread
}
messageDispatcher.messageReceived( source, m );
} catch( Exception e ) {
reportError(e);
reportError(p, m, e);
}
}
@ -186,7 +186,7 @@ public class KernelAdapter extends Thread
try {
createAndDispatch( event );
} catch( Exception e ) {
reportError(e);
reportError(event.getEndpoint(), event, e);
}
}
}
@ -209,7 +209,12 @@ public class KernelAdapter extends Thread
// when the connection add events come through
flushEvents();
createAndDispatch( e );
try {
createAndDispatch( e );
} catch( Exception ex ) {
reportError(e.getSource(), e, ex);
}
} catch( InterruptedException ex ) {
if( !go.get() )
return;

Loading…
Cancel
Save