title: Apache MINA session close call back
body: <p>Apache Mina - 2.0.1</p>
  
  <p>I have a IoHandlerAdapter which has call backs on sessionOpened and sessionClosed. When I open a session I login to the server and start sending requests, in "sessionClosed" I just restart my application.</p>
  
  <p>My application makes a check</p>
  
  <pre><code>if(!session.isClosing()) {
     //write to socket
  } else {
     //throw a runtime exception. Hopefully the sessionClosed API gets 
     //called soon and the next time this call will succeed.
  }
  </code></pre>
  
  <p>However I did notice that although the session.isClosing() returns true the session actually never gets closed. i.e, I dont really get the call back in my handler. Is this possible? How can I mitigate against such a risk. Can someone explain how long it takes for the close callback to be called?</p>