question: protected void closeChannel ( SocketChannel channel ) { if ( channel == null ) return ; Socket socket = channel . socket ( ) ; try { socket . shutdownInput ( ) ; socket . shutdownOutput ( ) ; socket . close ( ) ; } catch ( IOException ex ) { if ( _logger . isLoggable ( Level . FINE ) ) { _logger . log ( Level . FINE , "error while closing a key" , ex ) ; } } finally { try { channel . close ( ) ; } catch ( IOException ex ) { if ( _logger . isLoggable ( Level . FINE ) ) { _logger . log ( Level . FINE , "error while closing a channel" , ex ) ; } } } }
target:  Close a given channel