Handler? i suppose it is listener. Something like this :
future.addListener(new IoFutureListener(){
@Override
public void operationComplete(IoFuture ioFuture) {
try{
//logic here
}catch(Throwable t){
log.error("Greska ", t);
}finally{
//zatvaranje konekcije.
session.close();
}
}});
This scenario works in my test enviroment but in production, client si GPRS
terminal, there is problem.
Terminal does not accept all data. But when i remove session close(); line
it work fine.
On Fri, Sep 5, 2008 at 3:18 PM, Tuure Laurinolli <
[EMAIL PROTECTED]> wrote:
> Zlatko Josic wrote:
>
>> Yes that's right but for MINA 2.0. I use MINA 1.1. wich IoSession has not
>> closeOnFlush method.
>>
>
> Well, then you can add a handler to the WriteFuture of the last write, and
> close() in the handler.
>
>
>
>> On Fri, Sep 5, 2008 at 12:19 PM, Tuure Laurinolli <
>> [EMAIL PROTECTED]> wrote:
>>
>> Zlatko Josic wrote:
>>>
>>> Is there any solution to close session after writing all data to a
>>> client.
>>> See IoSession javadoc. There is a version of close() that takes boolean
>>> to
>>> determine whether to close immediately of after writing queued data, and
>>> also closeOnFlush(), which always waits for writes to complete.
>>>
>>
>