AbstractSession cs = (AbstractSession) session;
Buffer buffer = cs.createBuffer(SshConstants.Message.SSH_MSG_DISCONNECT, 0);
buffer.putInt(SshConstants.SSH2_DISCONNECT_BY_APPLICATION);
buffer.putString("Cancel");
buffer.putString("");
WriteFuture f = cs.writePacket(buffer);
f.await();
cs.getIoSession().suspendRead();
cs.getIoSession().suspendWrite();
TestEchoShellFactory.TestEchoShell.latch.await();