mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject Re: closing a session in Mina 2.0.0-M6
Date Sat, 06 Jun 2009 12:49:21 GMT
Kelly Wiles wrote:
> Hi
>
> When I close a session using the call
>    session.close(true).awaitUninterruptibly(3000);
>
> The session does not close for 60 seconds.
What do you mean ? Have you checked the CloseFuture.isClosed() result ?
CloseFuture closeFuture = session.close(true);
closeFuture.awaitUninterruptibly(3000);

if (closeFuture.isDone()) {
  // The session is closed...
}

> Is this the right way to shutdown a connection?
Yes, it will close the session.
>
> I am trying to send two messages to a server then once the responses 
> have returned I  shutdown my client program. But the client program 
> does not quit for 60 seconds.
You also have to dispose the Connector. Closing the session won't be enough.

-- 
--
cordialement, regards,
Emmanuel L├ęcharny
www.iktek.com
directory.apache.org



Mime
View raw message