locked
Error Recovery on UDP RRS feed

  • Question

  • I'm new to network programming. Right now I'm programming a client server communication channel
    using socket and udp protocol.
    This communication channel must have an automated error recovery when there is an error in the network.
    I know that in TCP if there is socket exception and the connection is broken, we need to reestablish it as a way
    to recover from the error.
    But in UDP, there is no connection. So if a socket exception occured when sending/receiving UDP packet,
    is it safe to assume that we just continue sending/receiving next packet (doing nothing to recover error)?
    Or must we do something like recreating the socket to recover from the error?
    Thursday, May 15, 2008 6:03 AM

All replies

  • There shouldn't be any need to recreated the socket as far as I can remembers.  You can do a check to see, send a UDP packets to a destination where there's no listening application, you'll get a WSAECONNRESET via a SocketException, see http://support.microsoft.com/kb/263823,  Then do another send and check that it is sent correctly too.

    Thursday, May 15, 2008 11:59 AM