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

查看:105
本文介绍了如何在Winsock中学习IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有5个登机门

门具有ip地址,并且端口号和数据相同

每个闸门都发送数据,但是我想了解哪个闸门向我发送数据(sendergate的地址是什么)


哪一个向我发送数据,这是什么门ip地址?

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?

推荐答案

您好,

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

希望这会有所帮助.

干杯,AT
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


这篇关于如何在Winsock中学习IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆