// If lucky, a couple of messages will even hit the handshake
// handler *after* the handshake has been completed but right
// before the handshake handler is removed from the pipeline.
// Worry not, that case is also covered :)
Thread.sleep(1L);
c.sendMessage((i + 1) + "\n");
}
// Run the client for some time, then shut it down.
latch.await(10, TimeUnit.SECONDS);
c.stop();