如何在AF

编程入门 行业动态 更新时间:2024-10-25 20:30:27
本文介绍了如何在AF_INET中获取客户端IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何获取AF_INET中的客户端IP地址? 我想写一个程序做为监听器! 并记录输入信息!

how can i get client ip address in AF_INET ? I want to write a program does as a listener! and log input information!

推荐答案

也许会帮助您: www.geekpage.jp/en/programming/linux-network/get- ipaddr.php [ ^ ] stackoverflow/Questions/5401942/how-to-get-get-the-ip-address-of-the-accepted-in-bound-socket [ ^ ] Maybe it will help you: www.geekpage.jp/en/programming/linux-network/get-ipaddr.php[^] stackoverflow/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.

更多推荐

如何在AF

本文发布于:2023-10-19 14:37:19,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1507819.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   AF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!