ServletUtils.copy(req, data.asOutputStream());
data.flip();
// decode the objects in the data
final List<?> messages = conn.decode(data);
// clear the buffer
data.free();
// messages are either of IoBuffer or Packet type
// handshaking uses IoBuffer and everything else should be Packet
for (Object message : messages) {
conn.handleMessageReceived(message);
}