Re: Lost network connection detection



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?



.



Relevant Pages

  • Re: Socket weirdness
    ... client) before you will notice a shutdown receive at server. ... Then eventually a packet comes from the peer, and that will contain data, so the server responds RST: ... way back across the network. ...
    (microsoft.public.dotnet.framework)
  • [SUMMARY]: How can we make a multihomed server replying on the same interface
    ... > Is there a way to make that the server sends his answer packet out on ... network route in the server to the network where the Firewalls are ... UDP-packet on that interface wich it believes it's closest to the ...
    (SunManagers)
  • Re: Re:SP4 error running replsys.sql
    ... Check your network documentation. ... The packet size option hasn't been changed on any of the servers, ... This looks quite similar to the threading bug in the original release of SQL ... This is a live server in a remote location, ...
    (microsoft.public.sqlserver.setup)
  • Re: Socket weirdness
    ... client) before you will notice a shutdown receive at server. ... Then eventually a packet comes from the peer, and that will contain data, so the server responds RST: ... Lets look now at what happens from the aspect of the client side. ... That then makes its way back across the network. ...
    (microsoft.public.dotnet.framework)
  • Re: Lost network connection detection
    ... sendtofunction - if the packet was sent at user mode. ... define "absence of network": UDP packet can be discarded before it gets sent ... He is sending and receiving UDP packets over a wireless network to ... when the network connection is lost and is reestablished. ...
    (microsoft.public.win32.programmer.networks)