Emmanuel Lecharny <elecharny@...> writes:
> > David Rosenstrauch a écrit : > >> > >> May be checking for the socket idleness every X minutes could help to > >> close the orphan sockets ? > > > > I'm not clear on what you mean by this. How would I do a check like > > that in MINA? Are you suggesting adding some sort of ping/pong logic? > > If not, then perhaps you could point me to some sample code that > > illustrates what you mean? > You can a SessionIdle event that can be used for that purpose. A session > is considered Idle if nothing happened for it during one second, and the > event is generated. I guess you can count the number of idle event you > received up to a point you consider the session dead. Also you can > consider that if all the sessions has received a Idle state, then > something is probably going wrong. > > You can set the expected maximum idle time for a session using > SessionConfig.setIdleTime( IdleStatus, long) (IdleStatus is used for > READ, WRITE or BOTH) > > Btw, some interesting reading : > http://mindprod.com/jgloss/socket.html#DISCONNECT > Hi, I want to know the functional difference between SessionConfig.setIdleTime( IdleStatus, long) and SshServer.getProperties().put(SshServer.IDLE_TIMEOUT, <some time>); Was able to test the 2nd case by leaving the session idle , however need to know the exact use of 1st one . How do I test 1st case ?