// start send
session.send("hello, world!");
session.send(new Integer(Integer.MAX_VALUE));
session.send(new Double(Math.random()));
session.send(new User("User 1", 20));
// send object and close the session
session.send("bye!").addListener(new FutureListener() {
public void futureCompleted(Future future) throws Exception {