Note that there are some explanatory texts on larger screens.

plurals
  1. POC# UDP multicast sockets - how to handle link failures
    text
    copied!<p>I'm working on a UDP Multicast library and got a question on how to properly handle link failures, disconnected/reconnected NIC cables, etc.</p> <p>In my test I have the following setup:</p> <ul> <li>2 servers sA and sB</li> <li>sA is sending UDP multicast data and sB is receiving multicast data</li> <li>servers are connected through a Layer 2 Cisco gigabit switch</li> </ul> <p>As an example, when I join the multicast group on sB I start receiving data on that socket from sA's multicast packets. </p> <p>Now, when I disable/unplug the NIC to which the multicast receiver sB is bound, I'm not receiving any socket level errors (e.g. in Socket.ReceiveAsync), which I guess is expected as UDP is connectionless, yet I was hoping I would get some kind of notification/exception as the IP that the multicast receiver is bound to becomes unavailable.</p> <p>Anyways, when I reenable that NIC, I'm not receiving any more data although the sender is still sending on the same multicast group. I was hoping that the Kernel would actually handle rejoining the multicast group after a hardware link failure but looks like it doesn't. However, since I'm not getting any socket level errors either, I don't really know how to detect a link failure for a multicast receiver? Are there certain socket options that need to be set so the kernel would rejoin a multicast group? The only option I came up with so far is listening for System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged events and attempt to rebind when I get a notification that the local IP I have to bind to becomes available again. How are other multicast applications handling that scenario?</p> <p>Thanks,</p> <p>Tom</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload