Hi,
I took a quick look in SSLFilter.java and wrote a simple
program. It seems that in the IoFilter.messageReceived()
method, we can simply intercept request and write back
the response by doing:
==========================================
public void messageReceived(
NextFilter nextFilter, IoSession session, Object message) {
// ... ...
WriteFuture writeFuture = new WriteFuture();
nextFilter.filterWrite( session,
new WriteRequest( heartbeatResponse, writeFuture ) );
}
==========================================
Is this a good practice? If Yes, I assume that the nextFilter
passed in actually is bi-directional, on reading side upward
and on writing side downward
Thanks a lot for your help!
Jian