OK. Once close() is called on BaseIoSession, its state switches to
'closing'.
In this state, calling write() leads to calling
WriteFuture.newNotWrittenFuture() which returns a 'fake' WriteFuture
without enqueuing the request.
So, you cannot write message to a closing session.
I thought we can write a message in filterClose() by doing like this:
void filterClose(...) {
WriteFuture future = next.filterWrite(...);
future.setCallback(new IoFuture.Callback() {
public void operationComplete(...) {
future.getSession().close();
}
});
}
If this doesn't work, this is a bug.
HTH,
Trustin
This works. I was calling session.write().
BTW. When sending messages from my filter, filterWrite of this filter
is called.
When closing session from my filter, filterClose is not called. Is it normal?
Thanks,
J-F