mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Re: Problem closing a session
Date Fri, 15 Jan 2010 17:27:25 GMT
Yongxing Wang a écrit :
> Yes.... that's exactly what I have experienced. It hangs if you call dispose inside of
the operationComplete. I kicked off another thread inside just to do the dispose. Any other
good ways?
I have added some info in https://issues.apache.org/jira/browse/DIRMINA-755.

The real problem is that calling dispose() in the listener is not 
necessarilly a good idea, for instance of you have more than one session 
associated to this Connector (you will then close all the sessions when 
one specific session is closed).

For some reasons, the way the Connctor is implemented makes it 
impossible to dispose() all the sessions properly while being in a 
listener, because we are processing this listener within the session's 
IoProcessor thread (and this is why it hangs : it waits on itself for 
ever). The solution could be to spawn a thread in the dispose() method 
to handle this case.

It's probably what I gonna do, but I can buy a portion of code doing that :)

Thanks !

Emmanuel Lécharny

View raw message