Hi Jian,
Sorry for being late.
On 12/7/06, jian wu <[EMAIL PROTECTED]> wrote:
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
Yep, it's bi-directional, and it's the way we write data in an IoFilter
implementation.
HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6