Thanks for the reply Chris, we'll analyse if it is possible to do that. Moisés
On Wed, Aug 18, 2010 at 1:04 PM, Christopher Popp <[email protected] > wrote: > Could you add something to your protocol so that when the user goes to > close the > application, you send a message indicating this to the server? > > Chris > > > > ________________________________ > From: Moisés Proenço Rosa <[email protected]> > To: [email protected] > Sent: Tue, August 17, 2010 5:08:17 PM > Subject: Detecting if the user really closed the connection or if the > connection > was lost > > Hi! > > We have an application where we need to know if an user terminated the > connection with the server using the application(closing it) or if the > connection has been lost due to network issues. It's a game server, and we > want to let the user reconnect and have his status back if the connection > is > lost, but not if the application was closed properly. > > We're using a KeepAliveFilter to detect if the client is still responsive, > in the KeepAliveRequestTimeoutHandler we are closing the session and > setting > an attribute "connection_lost" to this session, so on the sessionClosed of > our IoHandler implementation we can know if the disconnection was due to > keep-alive fail or not. > > The problem is that we're having IOException by "Connection reset by peer" > sometimes when an user lose his connection, we are testing by unplugging > the > network cable from a client machine. > > We tried to set the "connection_lost" attribute in the exceptionCaught of > our IoHandler implementation, but after investigating MINA code we realize > that we cannot be sure if exceptionCaught would be invoked previously than > sessionClosed or not. > > What can we do to detect the connection lost in all these cases? > > []'s > Moisés Rosa > > > > >
