开发者

UDP client multicast : join a group, what address to specify?

开发者 https://www.devze.com 2023-04-06 05:24 出处:网络
http://msdn.microsoft.com/en-us/library/ekd1t784.aspx The JoinMulticastGroup method subscribes the开发者_Python百科 UdpClient to a multicast group using the specified IPAddress.

http://msdn.microsoft.com/en-us/library/ekd1t784.aspx The JoinMulticastGroup method subscribes the开发者_Python百科 UdpClient to a multicast group using the specified IPAddress.

What address should I specify?

context: I have many computers, which I want to exchange messages between each other by udp multicasting so that one computer sends a message at once to all other members of a certain group.

also, how do I multicast the message using the send routine of udpclient http://msdn.microsoft.com/en-us/library/08h8s12k.aspx ?


While echoing @Vlad's suggestion on general network background, there is sample code in MSDN for the scenario you want here.

The following code example demonstrates how to join a multicast group by providing a multicast address.

Once you have members who have joined the group, any member can call Send to multicast to all members of the group.

Working through the MSDN docs to understand the sample code and relate it to your own situation should give you all you need to know for simple UDP multicast scenarios.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号