channel.setOut(out);
channel.setErr(err);
channel.open().await();
// ((AbstractSession) session).disconnect(SshConstants.SSH2_DISCONNECT_BY_APPLICATION, "Cancel");
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();
} finally {
TestEchoShellFactory.TestEchoShell.latch = null;
}