[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.mobile

Detecting loss of wireless TCP connection

Yechezkal Gutfreund

12/12/2002 12:18:00 AM

I am using async reads and writes (at the server and client).

If I crash the server or client (software crash) the loss of connection
(I am using networkstream sockets created by TCPCLient) are noticed
immediately.

However, if the wire breaks (either simulated or via an actual loss
of wireless connection) then I don't find out about this for about 1 minute.

I.e the async read does not return for about 1 minute after the wire break.

Is there:

1. A registry setting
2. A socket setting
3. Some other technique

That could help me find out quicker if the connection is broken?


--
=======
Dr. YSG
=======


2 Answers

Paul G. Tobey [eMVP]

12/12/2002 4:22:00 PM

0

That's probably a function of the TCP/IP stack, rather than the CF. It
often takes at least that long to detect a loss of connection. In fact, if
you are not communicating (sending and receiving), it's only through
keep-alive traffic that you'll *ever* detect the loss of connection (and the
default keep-alive doesn't start until the socket has been idle for two
hours).

Some of us were looking for a registry setting to control the time-out a
while back, but never found anything. If you hear from another source of a
way to adjust those parameters, please post it here.

Paul T.

"Y Gutfreund" <sgutfreund@hotmail.com> wrote in message
news:ek9FOvWoCHA.2596@TK2MSFTNGP08...
> I am using async reads and writes (at the server and client).
>
> If I crash the server or client (software crash) the loss of connection
> (I am using networkstream sockets created by TCPCLient) are noticed
> immediately.
>
> However, if the wire breaks (either simulated or via an actual loss
> of wireless connection) then I don't find out about this for about 1
minute.
>
> I.e the async read does not return for about 1 minute after the wire
break.
>
> Is there:
>
> 1. A registry setting
> 2. A socket setting
> 3. Some other technique
>
> That could help me find out quicker if the connection is broken?
>
>
> --
> =======
> Dr. YSG
> =======
>
>


Yechezkal Gutfreund

12/12/2002 11:57:00 PM

0

What you say makes good sense. The issue is that this is a wireless
PDA application (e.g. game) connected to a server. I really want the
gamers to be notified as soon as possible that their actions are
not being forwarded.

The application already does a automatic reconnect.
It then does a "restore
state" from the server when the wireless PDA re-connects.

It is not a shooter game, so this momentary loss is really not
an issue. I really just want to notice the loss of connection quicker.

Would sending empy "heartbeat" packets from both sides do the trick?
Sending them on a 1 second interval would be better than the
1 minute timeouts I see now. I would use an interval timer with
callbacks to do this.


"Paul G. Tobey [eMVP]" <ptobey_nospam@instrument.com> wrote in message
news:OrC$MJfoCHA.2012@TK2MSFTNGP11...
> That's probably a function of the TCP/IP stack, rather than the CF. It
> often takes at least that long to detect a loss of connection. In fact,
if
> you are not communicating (sending and receiving), it's only through
> keep-alive traffic that you'll *ever* detect the loss of connection (and
the
> default keep-alive doesn't start until the socket has been idle for two
> hours).
>
> Some of us were looking for a registry setting to control the time-out a
> while back, but never found anything. If you hear from another source of
a
> way to adjust those parameters, please post it here.
>
> Paul T.
>
> "Y Gutfreund" <sgutfreund@hotmail.com> wrote in message
> news:ek9FOvWoCHA.2596@TK2MSFTNGP08...
> > I am using async reads and writes (at the server and client).
> >
> > If I crash the server or client (software crash) the loss of connection
> > (I am using networkstream sockets created by TCPCLient) are noticed
> > immediately.
> >
> > However, if the wire breaks (either simulated or via an actual loss
> > of wireless connection) then I don't find out about this for about 1
> minute.
> >
> > I.e the async read does not return for about 1 minute after the wire
> break.
> >
> > Is there:
> >
> > 1. A registry setting
> > 2. A socket setting
> > 3. Some other technique
> >
> > That could help me find out quicker if the connection is broken?
> >
> >
> > --
> > =======
> > Dr. YSG
> > =======
> >
> >
>
>