15

I am familiarizing myself with Multicasting and such.

There are 2 primary examples used:

  1. Using Socket with Bind()

  2. UDPClient.JoinMulticastNetwork()

One specifiying a LeaveMulticastGroup and another binding and Joining with no LeaveMulticastGroup()

What is the difference between the 2 methods of Multicasting, which is preferable to use?

1 Answer 1

12
+25

The difference is in the level of abstraction between using a UdpClient class and managing your multicast on a lower level, using sockets and multicast option. If you use a UdpClient, then you don't need to worry about sockets and multicast options, since that is done under the hood in the UdpClient class. If you want more control over what is happening, than you can use a more low-level approach with socket and multicast option.

It is probably easier to implement basic multicasting functionality by using a UdpClient.

For reference, you can check the following two tutorials (the first uses a UdpClient and is more high-level, while the second uses sockets and multicast option):

  1. UDP Multicasting Tutorial
  2. IP Multicasting in C#

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.