开发者

Get destination IP-address of UDP packet

开发者 https://www.devze.com 2023-01-22 04:38 出处:网络
When using the C# UDPClient to receive data, how do I determine if the received datagram was a broadcast packet or not?

When using the C# UDPClient to receive data, how do I determine if the received datagram was a broadcast packet or not?

I can determine the source IP-address by reading the endpoint from UdpClient.Receive(endpoint), but I can't figure out how to get the remote IP-address of the p开发者_StackOverflow社区acket. Is there a way to do that?


updClient.Client.RemoteEndPoint will be of type IPEndPoint that has an Adrdress Property.

0

精彩评论

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