Write and read is only the real way to detect disconnect. Sockets can be valid and live on after a disconnect and reconnect.
When a network cable is removed, you may get a disconnect after the OS internal timeout. Otherwise you have to rely on your own idleness timer. On Apr 17, 2015 6:28 AM, "Nikunj Patel" <aang...@gmail.com> wrote: > Dear Sir, > > I have develop MINA Client which is connected to remote server. I am trying > to detect Wired Network Disconnect in that but it is not identify it. Also > session.write is not generating any exception. Before submit if i check > with session.isConnected then also it return true. > > Can any one help me how I can detect such network disconnection in Apache > Mina. > > -- > Regards, > Nikunj Patel. >