Catch another case where shutdown state can cause a

key to be invalid before it is checked.  The "bug"
was that shutdown of a network server would occasionally
log an exception about a canceled key.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10947 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
experimental
PSp..om 11 years ago
parent a499e972ab
commit 90913bf8c3
  1. 6
      engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java

@ -455,11 +455,15 @@ public class SelectorKernel extends AbstractKernel
// Check for available keys and process them
try {
select();
select();
} catch( ClosedSelectorException e ) {
if( !go.get() )
return; // it's because we're shutting down
throw new KernelException( "Premature selector closing", e );
} catch( CancelledKeyException e ) {
if( !go.get() )
return; // it's because we're shutting down
throw new KernelException( "Invalid key state", e );
} catch( IOException e ) {
if( !go.get() )
return; // error likely due to shutting down

Loading…
Cancel
Save