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.getOut().write(buffer.array(), buffer.rpos(), buffer.available());
channel.getOut().flush();
}
public void exceptionCaught(IoSession session, Throwable cause) throws Exception {
cause.printStackTrace();