PC Review


Reply
Thread Tools Rate Thread

Detecting broken TCP connections

 
 
Jumu
Guest
Posts: n/a
 
      4th Apr 2005
Hello,

I am trying to build an application on the .NET pocketPC platform that
transmits and receives data through TCP sockets. Ideally I want the
application to work on all types of connections like GPRS, Wifi and any
other technologies that support TCP sockets.

This means there is the possibility of connections going down and
coming back again. For example, a Wifi user might go out of range of
the base station and then come back. So my specific questions are:

1. How do I inform my application that the link is no longer available.

2. How do I inform it that the link has come back up.

3. What is the way to handle open TCP sockets while the link is down
and then comes back up.

Also, if the link becomes very slow for some reason (say bad GPRS in an
area) do I have be mindful of how much data my application is writing
to my TCP socket send-buffer. Could it get overwhelmed and drop packets
at the OS level itself, even before the packets get "airborne"?

Any suggestions, ideas, further reading pointers will be appreciated.

Thanks for reading

 
Reply With Quote
 
 
 
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      4th Apr 2005
TCP will either deliver the packets, in the order specified, or it will call
the connection broken; that's the benefit of TCP over UDP where you can't
guarantee delivery or know what the delivery order will be.

Just standard TCP stuff is what you will probably want for detecting loss of
connection: keep-alive and time-outs. When you're sending data over the
socket regularly, you should detect a lost connection in about 30-40
seconds. If you're passively sitting there waiting for new data from the
other end of the connection, you'll have to have keep-alive enabled for the
socket or there'll be no detectable difference between losing the connection
and just never having the other end send you anything. Since keep-alive was
never designed for real-time notifications that hey, there's no signal from
an AP right now, etc., you'll have to change the time-out to get real-time
information (and this costs you more packets sent periodically to verify
that that other end of the connection is still there).

I've been over this before with people, so you might want to look up "keep
alive" in the archives and see what's been said before, and then ask
questions, rather than waiting for a new tutorial...

http://groups-beta.google.com/group/...UTF-8&oe=UTF-8

Paul T.

"Jumu" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I am trying to build an application on the .NET pocketPC platform that
> transmits and receives data through TCP sockets. Ideally I want the
> application to work on all types of connections like GPRS, Wifi and any
> other technologies that support TCP sockets.
>
> This means there is the possibility of connections going down and
> coming back again. For example, a Wifi user might go out of range of
> the base station and then come back. So my specific questions are:
>
> 1. How do I inform my application that the link is no longer available.
>
> 2. How do I inform it that the link has come back up.
>
> 3. What is the way to handle open TCP sockets while the link is down
> and then comes back up.
>
> Also, if the link becomes very slow for some reason (say bad GPRS in an
> area) do I have be mindful of how much data my application is writing
> to my TCP socket send-buffer. Could it get overwhelmed and drop packets
> at the OS level itself, even before the packets get "airborne"?
>
> Any suggestions, ideas, further reading pointers will be appreciated.
>
> Thanks for reading
>



 
Reply With Quote
 
Jumu
Guest
Posts: n/a
 
      4th Apr 2005
Thanks for the valuable suggestions @ Paul, I will look up the "keep
alive" threads you mentioned.

Jumu

 
Reply With Quote
 
=?Utf-8?B?TGV3aXM=?=
Guest
Posts: n/a
 
      5th Apr 2005
Jumu,

Did you ever find the answers to your questions? If so, would you mind
providing me with pointers to your solutions?

Many thanks in advance,

Lewis.

"Jumu" wrote:

> Hello,
>
> I am trying to build an application on the .NET pocketPC platform that
> transmits and receives data through TCP sockets. Ideally I want the
> application to work on all types of connections like GPRS, Wifi and any
> other technologies that support TCP sockets.
>
> This means there is the possibility of connections going down and
> coming back again. For example, a Wifi user might go out of range of
> the base station and then come back. So my specific questions are:
>
> 1. How do I inform my application that the link is no longer available.
>
> 2. How do I inform it that the link has come back up.
>
> 3. What is the way to handle open TCP sockets while the link is down
> and then comes back up.
>
> Also, if the link becomes very slow for some reason (say bad GPRS in an
> area) do I have be mindful of how much data my application is writing
> to my TCP socket send-buffer. Could it get overwhelmed and drop packets
> at the OS level itself, even before the packets get "airborne"?
>
> Any suggestions, ideas, further reading pointers will be appreciated.
>
> Thanks for reading
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting Broken links DMc2005 Microsoft Excel Programming 0 18th Dec 2006 04:15 PM
Detecting RAS and Network Connections =?Utf-8?B?Sm9obiBHZW9yZ292c2tp?= Microsoft Dot NET Compact Framework 0 17th Jan 2005 10:53 AM
Detecting network connections. =?Utf-8?B?ZHRw?= Microsoft VC .NET 0 5th Jan 2005 04:27 PM
Detecting dropped socket connections Mike Ruane-Torr Microsoft C# .NET 1 18th Mar 2004 03:02 PM
Detecting Network Connections Kunal Microsoft C# .NET 1 18th Dec 2003 07:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:42 AM.