How do I determine the source IP of a multicast packet in C#?

前端 未结 1 1524
名媛妹妹
名媛妹妹 2020-12-18 00:39

I need to determine the IP of a machine that has sent me a multicast packet, so that I can respond to it via unicast.

I\'m using the following csharp (.Net 3.5) code

相关标签:
1条回答
  • 2020-12-18 01:12

    Isn't your answer in the LocalEndPoint variable, which is the EndPoint of the packet's source, i.e., the dude on the other end. Note that I would probably rename this variable something like "remoteEP", and initialize it to something non-specific to avoid confusion.

    0 讨论(0)
提交回复
热议问题