mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Zlatko Josic" <zlatko.jo...@gmail.com>
Subject Re: MINA 1.1 IoSession.close() problem
Date Fri, 05 Sep 2008 13:33:06 GMT
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 <
tuure.laurinolli@indagon.com> 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 <
>> tuure.laurinolli@indagon.com> 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.
>>>
>>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message