4 messages in org.apache.mina.devdetection of lost connection when it ...
FromSent OnAttachments
Fernando C. de CastroSep 15, 2006 6:54 pm 
Trustin LeeSep 15, 2006 9:50 pm 
Mike GrundvigSep 16, 2006 8:39 am 
Vinod PanickerSep 17, 2006 8:23 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:detection of lost connection when it doesn't close "cleanly"Actions...
From:Fernando C. de Castro (fern@altriz.com.br)
Date:Sep 15, 2006 6:54:04 pm
List:org.apache.mina.dev

Hello,

I looked in the archive before posting this and couldn't find an answer, so
please excuse me if it has already been commented.

I was wondering if there is a way to detect a lost connection when the other
side doesn't close the connection "cleanly".

Actually the server I wrote with MINA takes connections from GPRS modules and
eventually sends messages to some of them. The matter is that sometimes the GPRS
modules face some network problem and lose their IP session. When that happens,
MINA (or the Operating System, for that matter) takes a long time (many minutes)
to realize the connection is gone.

I am aware that there are means to adjust this delay within the OS, but I was
expecting MINA to check that for me. If MINA sends a string of bytes for which
the TCP/IP stack never got an ACK, I think MINA was supposed to know it.

Of course I could implement some kind of protocol to check for active
connections: the GPRS modules could periodically send some data, and
sessionIdle() would point out the 'mute' peers and then those sessions could be
closed. But that isn't very much efficient, and also the GPRS is charged by
traffic and this approach would result in a high fixed cost for the system.

I was hoping MINA could confirm that all bytes scheduled to be sent for a
certain session were actually received by the other party; if some bytes remain
there after a Timeout, then some event should be triggered.

Is there any easy way to achieve this, and I'm still not able to see?

Thanks in advance,

Fernando