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("");
IoWriteFuture f = cs.writePacket(buffer);
f.await();
suspend(cs.getIoSession());
TestEchoShellFactory.TestEchoShell.latch.await();
} finally {
TestEchoShellFactory.TestEchoShell.latch = null;