mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jian wu" <hellojia...@gmail.com>
Subject Question for intercepting the request and directly writing back in IoFilter
Date Thu, 07 Dec 2006 08:19:49 GMT

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!


View raw message