public void disconnect ( int reason , String disconnectReason ) { ByteArrayWriter baw = new ByteArrayWriter ( ) ; try { this . disconnectReason = disconnectReason ; baw . write ( SSH_MSG_DISCONNECT ) ; baw . writeInt ( reason ) ; baw . writeString ( disconnectReason ) ; baw . writeString ( "" ) ; Log . info ( this , "Sending SSH_MSG_DISCONNECT [" + disconnectReason + "]" ) ; sendMessage ( baw . toByteArray ( ) , true ) ; } catch ( Throwable t ) { } finally { try { baw . close ( ) ; } catch ( IOException e ) { } internalDisconnect ( ) ; } }
Disconnect from the remote host . No more messages can be sent after this method has been called .