On 01/14/2010 04:10 PM, Leandro Casadei wrote:
Hi, I'm having a little problem using MINA as a client.
When I'm done sending messages, I call the following code:
CloseFuture future = session.close(true);
future.awaitUninterruptibly();
connector.dispose();
The problem is that the second line keeps waiting forever, causing file
descriptors leaks.
My questions would be:
What could be the reason for this method to hang?
The server isn't doing something this method expect?
Btw: The server is also using MINA.
Thanks.
I've been handling session close as follows, and it's been working well:
CloseFuture closeFuture = getSession().close(closeImmediately);
closeFuture.addListener(new CloseSessionListener());
...
class CloseSessionListener implements IoFutureListener<CloseFuture> {
public void operationComplete(CloseFuture future) {
<do cleanup here>
}
}
HTH,
DR