Moved some exception handling to terminate connections

that throw low level exceptions.  The specific case I
saw for this was "An existing connection was forcibly
closed by the remote host" IOException.  Without this
new handling, SM continually tried to send the connection
its data.


git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7260 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
PSp..om 14 years ago
parent 9073820361
commit d0a5ce55b9
  1. 12
      engine/src/networking/com/jme3/network/kernel/tcp/SelectorKernel.java

@ -418,12 +418,24 @@ public class SelectorKernel extends AbstractKernel
continue; continue;
} }
try {
if( key.isAcceptable() ) if( key.isAcceptable() )
accept(key); accept(key);
else if( key.isWritable() ) else if( key.isWritable() )
write(key); write(key);
else if( key.isReadable() ) else if( key.isReadable() )
read(key); read(key);
} catch( IOException e ) {
if( !go.get() )
return; // error likely due to shutting down
reportError( e );
// And at this level, errors likely mean the key is now
// dead and it doesn't hurt to kick them anyway. If we
// find IOExceptions that are not fatal, this can be
// readdressed
cancel( key, (SocketChannel)key.channel() );
}
} }
} }

Loading…
Cancel
Save