Re: Lost network connection detection
- From: "Volodymyr M. Shcherbyna" <v_scherbina@xxxxxxxxxxxxxxx>
- Date: Mon, 7 Apr 2008 10:51:27 +0200
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?
.
- Follow-Ups:
- Re: Lost network connection detection
- From: stgislander
- Re: Lost network connection detection
- References:
- Lost network connection detection
- From: stgislander
- RE: Lost network connection detection
- From: Void
- Lost network connection detection
- Prev by Date: Re: non-blocking connect might block winsock? ?????????
- Next by Date: Re: non-blocking connect might block winsock? ?????????
- Previous by thread: RE: Lost network connection detection
- Next by thread: Re: Lost network connection detection
- Index(es):
Relevant Pages
|