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 07:25:04 GMT
Quoting daune.jf@daune-consult.com:

> Quoting peter royal <proyal@apache.org>:
>
>> On Jun 30, 2006, at 1:36 PM, daune.jf@daune-consult.com wrote:
>>> I have implemented a filter, and in filterClose() I send a message  
>>>     without calling nextFilter.filterClose().
>>>
>>> The message is never sent. I added a Callback to WriteFuture, and   
>>>    isWritten returns false.
>>>
>>> Is it forbidden to send messages in filterClose?
>>
>> Off the top of my head, you may be getting the filterClose event
>> because the other end closed the connection, in which case, you can't
>> write them anything else.
>>
>> I would think that what you're trying to do would work if the close
>> was initiated by IoSession.close() on the side that you're trying to
>> do this behavior.
>>
>> -pete
>
> I am now sure that it is not the client that closes the connection.
>
> Is it possible to determine why message is not sent? WriteFuture only
> has a boolean indicating success or failure. How can I know the
> failure reason?
>
> J-F


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.

J-F



Mime
View raw message