且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在AF_INET中获取客户端IP地址

更新时间:2023-01-03 18:41:58

也许会帮助您:
http://www.geekpage.jp/en/programming/linux-network/get- ipaddr.php [ ^ ]
http://***.com/Questions/5401942/how-to-get-get-the-ip-address-of-the-accepted-in-bound-socket [ ^ ]
Maybe it will help you:
http://www.geekpage.jp/en/programming/linux-network/get-ipaddr.php[^]
http://***.com/questions/5401942/how-to-get-the-ip-address-of-the-accepted-in-bound-socket[^]


不完全确定这是您的意思,但是您可以为 accept [ ^ ]调用(您可以使用它接受来自客户端),其中填满了客户端的IP和端口. Google提供了"accept socket"以获取更多信息和可能的示例.
Not completely sure this is what you mean, but you can specify a struct to the accept[^] call (you use this to accept connection requests from clients) that is filled with the client''s IP and port. Google for "accept socket" for more information and possible examples.