mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From daune...@daune-consult.com
Subject Re: Sendind message in filterClose
Date Mon, 03 Jul 2006 09:10:09 GMT
>> 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



Mime
View raw message