[ https://issues.apache.org/jira/browse/SSHD-93?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12922103#action_12922103 ]
Russ Tennant edited comment on SSHD-93 at 10/18/10 11:19 AM: ------------------------------------------------------------- No, it doesn't for me. I thought that was purposeful although I didn't read the spec to verify. In ServerSession.java, close(false) is called which doesn't cause Command.destroy() to be called. If I changed that to close(true), then destroy is called. protected void handleMessage(Buffer buffer) throws Exception { 118 SshConstants.Message cmd = buffer.getCommand(); 119 log.debug("Received packet {}", cmd); 120 switch (cmd) { 121 case SSH_MSG_DISCONNECT: { 122 int code = buffer.getInt(); 123 String msg = buffer.getString(); 124 log.info("Received SSH_MSG_DISCONNECT (reason={}, msg={})", code, msg); 125 close(false); 126 break; 127 } was (Author: toga98): No, it doesn't. I thought that was purposeful although I didn't read the spec to verify. In ServerSession.java, close(false) is called which doesn't cause Command.destroy() to be called. If I changed that to close(true), then destroy is called. protected void handleMessage(Buffer buffer) throws Exception { 118 SshConstants.Message cmd = buffer.getCommand(); 119 log.debug("Received packet {}", cmd); 120 switch (cmd) { 121 case SSH_MSG_DISCONNECT: { 122 int code = buffer.getInt(); 123 String msg = buffer.getString(); 124 log.info("Received SSH_MSG_DISCONNECT (reason={}, msg={})", code, msg); 125 close(false); 126 break; 127 } > Detect SSH_MSG_DISCONNECT > ------------------------- > > Key: SSHD-93 > URL: https://issues.apache.org/jira/browse/SSHD-93 > Project: MINA SSHD > Issue Type: Question > Affects Versions: 0.4.0 > Reporter: Russ Tennant > Priority: Minor > > Is there a way for a org.apache.sshd.server.Command to detect that a user has > disconnected? I'd like to shutdown my command shell when this happens. For > example, when a user disconnects their SSH client (e.g open ssh "~."). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.