On Nov 12, 2007 10:08 PM, Bogdan Ciprian Pistol <[EMAIL PROTECTED]> wrote:
> Hello,
>
> In a IoHandler if I do:
>
> session.write(something);
> session.close( );
>
> Is it OK? It is possible that session.close( ) will be called in the
> middle of session.write(something)?

Not OK.

> Or I should do it like this:
>
> session.write(something).join( );
> session.close( );

The best way is:

session.write(something).addListener(IoFutureListener.CLOSE);

HTH,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Reply via email to