I been able to parse the data and get a valid message using XXX
not I want to send back data to the client.
I found differents ways to send to the client, but don't know which one I
should use.
ctx.getAsyncQueueWritable().writeToAsyncQueue(buffer, null, null, true);
or
SelectableChannel channel = context.getSelectionKey().channel();
try {
//DEBUG HERE.. just to see how that work.
ByteBuffer writeBuffer =
ByteBuffer.allocateDirect(query.length());
writeBuffer.put(query.getBytes());
writeBuffer.flip();
if (context.getProtocol() == Controller.Protocol.TCP) { // TCP
case
OutputWriter.flushChannel(channel, writeBuffer);
}
} catch (IOException ex) {
throw ex;
}