0

Good day all

I am going through the MSDN website try to familiarize mystelf with Multicasting and how it works. I'm wondering: when does one use the

IPAddress.Any

it refers to a commented out line from this link

//IPAddress localIP = IPAddress.Any;

I have seen it on multiple occasions, but what does IPAddress.Any really mean?

UPDATE

enter image description here

CybeX
  • 2,060
  • 3
  • 48
  • 115

1 Answers1

2

A quick googling reveals:

What's IPAddress.Any - MSDN Forums:

IPAddress.Any will listen on any IP Addresses assigned to the PC. For example, if I am connected to the network via wireless and wired, there would be two IP Addresses assigned. This means that I would listen for requests on both IP Addresses. If I would take the IP of say the wired then I could only receive requests from that NIC.

As you can see, this is for specifying an address to listen on (effectively, an equivalent to IPAddress.Parse("0.0.0.0")) and thus is not specific to multicasting. See How to do a UDP multicast across the local network in c#? for an example of the latter's implementation.

Community
  • 1
  • 1
ivan_pozdeev
  • 33,874
  • 19
  • 107
  • 152