I forget how Mina handles it but SocketChannel write and read both generate exceptions to alert of disconnect.
Mina may abstract that somehow. On Apr 17, 2015 8:38 AM, "Nikunj Patel" <[email protected]> wrote: > Is there any way where session.write() can generate any exception and base > on that we can take decision. > > On Fri, Apr 17, 2015 at 6:00 PM, Jon V. <[email protected]> wrote: > > > 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" <[email protected]> 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. > > > > > > > > > -- > Regards, > Nikunj Patel. >
