public void messageReceived(IoSession session, Readable message) throws Exception {
TcpipClientChannel channel = (TcpipClientChannel) session.getAttribute(TcpipClientChannel.class);
Buffer buffer = new Buffer();
buffer.putBuffer(message);
channel.waitFor(ClientChannel.OPENED | ClientChannel.CLOSED, Long.MAX_VALUE);
channel.getInvertedIn().write(buffer.array(), buffer.rpos(), buffer.available());
channel.getInvertedIn().flush();
}
public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
cause.printStackTrace();