cancel( key, (SocketChannel)key.channel() );
protected void read( SelectionKey key ) throws IOException { NioEndpoint p = (NioEndpoint)key.attachment(); SocketChannel c = (SocketChannel)key.channel(); working.clear(); int size; try { size = c.read(working); } catch( IOException e ) { // The remove end forcibly closed the connection... // close out our end and cancel the key cancel( key, c ); return; } if( size == -1 ) { // The remote end shut down cleanly... // close out our end and cancel the key cancel( key, c ); return; } newData( p, c, working, size ); }
cancel( key, (SocketChannel)key.channel() );
cancel( key, (SocketChannel)key.channel() );
protected void read( SelectionKey key ) throws IOException { NioEndpoint p = (NioEndpoint)key.attachment(); SocketChannel c = (SocketChannel)key.channel(); working.clear(); int size; try { size = c.read(working); } catch( IOException e ) { // The remove end forcibly closed the connection... // close out our end and cancel the key cancel( key, c ); return; } if( size == -1 ) { // The remote end shut down cleanly... // close out our end and cancel the key cancel( key, c ); return; } newData( p, c, working, size ); }
protected void read( SelectionKey key ) throws IOException { NioEndpoint p = (NioEndpoint)key.attachment(); SocketChannel c = (SocketChannel)key.channel(); working.clear(); int size; try { size = c.read(working); } catch( IOException e ) { // The remove end forcibly closed the connection... // close out our end and cancel the key cancel( key, c ); return; } if( size == -1 ) { // The remote end shut down cleanly... // close out our end and cancel the key cancel( key, c ); return; } newData( p, c, working, size ); }
/** * Called by the endpoints when they need to be closed. */ protected void closeEndpoint( NioEndpoint p ) throws IOException { //log.log( Level.FINE, "Closing endpoint:{0}.", p ); thread.cancel(p); }
/** * Called by the endpoints when they need to be closed. */ protected void closeEndpoint( NioEndpoint p ) throws IOException { log.log( Level.INFO, "Closing endpoint:{0}.", p ); thread.cancel(p); }
/** * Called by the endpoints when they need to be closed. */ protected void closeEndpoint( NioEndpoint p ) throws IOException { //log.log( Level.FINE, "Closing endpoint:{0}.", p ); thread.cancel(p); }