如何在winsock中学习ip地址?[英] how to learn ip address in winsock?

本文是小编为大家收集整理的关于如何在winsock中学习ip地址?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

有5个门

门有 ip 地址和相同的端口号和数据

每个门都发送数据,但我想知道哪个门向我发送数据(sendergate 的 IP 地址是什么)


哪个给我发数据 这个门的ip地址是什么?

推荐答案

你好,

如果您使用 UdpClient 而不是 Socket,则可以使用 Async EndReceive(ar, ref endPoint).完成后,endPoint 将包含数据来源的地址(我相信问题是)

希望这会有所帮助.

干杯,AT

本文地址:https://www.itbaoku.cn/post/1394897.html

问题描述

there are 5 gates

gates have ip adresses and same port number and data

each gates send data but ı want to learn which gate send me data(what is the ipadress of sendergate)


which one send me data what is this gate ip adress?

推荐答案

Hi,

If you use the UdpClient instead of the Socket you can use the Async EndReceive(ar, ref endPoint). After completion the endPoint will contain the address from where the data came (as I believe the question was)

Hope this helps.

Cheers, AT