Sajit Zachariah wrote:
Hi All,
I am seeing a strange behaviour from MINA in the following scenario.
MINA is used for writing the client which connects to a device on tcp/ip. After establishing the connection with the device, If the network cable is unplugged of the device/client is unplugged, I was expecting a sessionclosed invocation but it is not happening.
Please let me know if any of you have faced this issue before and any known
workaround for this.. I am using MINA 1.0.5
Thanks
-Sajit
Hi,
That's just the way TCP/IP works. You will need to add some kind of
keep-alive message to your protocol. The server will send some message
to the device periodically to see if it's still connected. You can use
sessionIdle() to send such messages. Here's a previous thread you should
read:
http://www.nabble.com/How-to-get-MINA-to-detect-a-lost-connection--td12164649s16868.html#a12165692
There's a KeepAliveFilter in trunk. Maybe you could backport it for use
with MINA 1.0.5?
BTW, this is a very question. We should have it in the FAQ.
/Niklas