Re: Lost network connection detection
- From: stgislander <stgislander@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 9 Apr 2008 05:42:00 -0700
Thank-you Void and Volodymyr both.
Our developer tells me that he ultimately decided pinging the server was his
best option. I believe he was originally looking for a hook into the Windows
messaging system to tell him when the connection was present or missing.
UDP was originally selected because a few years back we were required to
send data packets from multiple remote nodes to the server in a max burst of
2000 times a second. The overhead associated with TCP was determined to be
too great, and we did not care if a packet was ocassionally lost or dropped.
stgislander
"Volodymyr M. Shcherbyna" wrote:
Basically, the general suggestion is to check the return values of.
sendto(...) function - if the packet was sent at user mode. But one has to
define "absence of network": UDP packet can be discarded before it gets sent
to network. Also, the fact, that the packet is sent, does not mean that it
will be delivered, or delivered in proper sequence.
What I actually investigated, is that on a bit lower level, at TDI one may
get the following error codes when sending UDP packets (error codes observed
from completion routine which was set for each TDI_SEND_DATAGRAM IRP):
STATUS_HOST_UNREACHABLE, STATUS_IO_TIMEOUT, STATUS_CANCELLED,
NT_STATUS_NETWORK_UNREACHABLE, STATUS_INSUFFICIENT_RESOURCES
I hope this will help.
--
V.
This posting is provided "AS IS" with no warranties, and confers no
rights.
"Void" <Void@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:839D95EF-604B-48F9-ADB3-C3D7F7285242@xxxxxxxxxxxxxxxx
Generally, you would use TCP for any kind of connection oriented
programming.
UDP is a one way ticket. The only thing i can think is pinging the server
before sending the packet. Is there a particular advantage that your
looking
for that directed you to UDP?
"stgislander" wrote:
I'm forwarding this question from a retired software developer who
truthfully
is having a difficult time reading the small text on the forum.
He is sending and receiving UDP packets over a wireless network to
control a
semi-autonomous model, and is trying to development a routine that can
detect
when the network connection (carrier) is lost and is reestablished. Much
like the balloons that pop up over the network connection icon when the
network cable is unplugged and replugged. If he can detect this, he can
notify the program operator when lost and reset his ports when it
returns.
He tells me he has tried a few methods but not seem to work well, so he
is
diving back into the Winsock implementation to see if he is missing
something.
What is the best way to detect a lost network connection?
- References:
- Lost network connection detection
- From: stgislander
- RE: Lost network connection detection
- From: Void
- Re: Lost network connection detection
- From: Volodymyr M. Shcherbyna
- Lost network connection detection
- Prev by Date: Re: gethostbyname return internal ip address when it should return external
- Next by Date: Re: Read a Huge file and send via SOCKET
- Previous by thread: Re: Lost network connection detection
- Next by thread: non-blocking connect might block winsock? Параметры
- Index(es):
Relevant Pages
|