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
This commit is contained in:
parent
a499e972ab
commit
90913bf8c3
@ -455,11 +455,15 @@ public class SelectorKernel extends AbstractKernel
|
|||||||
|
|
||||||
// Check for available keys and process them
|
// Check for available keys and process them
|
||||||
try {
|
try {
|
||||||
select();
|
select();
|
||||||
} catch( ClosedSelectorException e ) {
|
} catch( ClosedSelectorException e ) {
|
||||||
if( !go.get() )
|
if( !go.get() )
|
||||||
return; // it's because we're shutting down
|
return; // it's because we're shutting down
|
||||||
throw new KernelException( "Premature selector closing", e );
|
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 ) {
|
} catch( IOException e ) {
|
||||||
if( !go.get() )
|
if( !go.get() )
|
||||||
return; // error likely due to shutting down
|
return; // error likely due to shutting down
|
||||||
|
Loading…
x
Reference in New Issue
Block a user