How to do a UDP multicast across the local network in c#?

后端 未结 3 1627
庸人自扰
庸人自扰 2020-12-28 21:31

I am trying to get some simple UDP communication working on my local network.

All i want to do is do a multicast to all machines on the network

Here is my se

3条回答
  •  无人及你
    2020-12-28 21:46

    I've just spent 4 hours on something similar (I think), the solution for me was:

    client.Client.Bind(new IPEndPoint(IPAddress.Any, SSDP_PORT));
    client.JoinMulticastGroup(SSDP_IP,IP.ExternalIPAddresses.First());
    client.MulticastLoopback = true;
    

    Using a specific (first external) IP address on the multicast group.

提交回复
热议问题