public class DaytimeHandler extends SessionHandlerAdapter {
public void sessionStarted(Session session) throws Exception {
ByteBuffer buffer = Charset.UTF8.encode(new Date().toString());
Future future = session.flush(new DefaultPacket(buffer));
future.addListener(new FutureListener() {
public void futureCompleted(Future future) throws Exception {
future.getSession().close();
}
});