I am relying on the session idle event to detect if a client got disconnected (in case of un-graceful connection break). To do this I have added logic to my TCP clients to send a "keep alive" message every 2 seconds. And I have configured the server to detect idle events using acceptor.getSessionConfig().setIdleTime(IdleStatus.READER_IDLE, 2);
When I get 3 consecutive idle events - my server logic assumes that the client is disconnected and closes the session. I get the count using int readerIdleEventCount = session.getReaderIdleCount(); Is the above logic the right way to handle my scenario? I want to understand when I should use READER_IDLE/WRITER_IDLE/BOTH_IDLE? Thanks, Saurav On Thu, May 30, 2013 at 12:01 PM, Emmanuel Lécharny <[email protected]>wrote: > Le 5/30/13 7:55 AM, Saurav Gulati a écrit : > > Hello Team, > > > > I am using keep alive in my app. At session idle > > to count idle event what should in them > > session.getBothIdleCount() or session.getReaderIdleCount() > > Can you be a bit moe specific about wht you want ? > > > -- > Regards, > Cordialement, > Emmanuel Lécharny > www.iktek.com > >
