简体   繁体   English

如何找到一个 AF_UNIX 套接字并查看通过它的信息?

[英]How to find an AF_UNIX socket and see the information passing through it?

There is an application running on a FreeBSD 10.1 release operating system and i need to figure out how to find the sockets it has created and is using.有一个应用程序在FreeBSD 10.1 release操作系统上运行,我需要弄清楚如何找到它已创建并正在使用的套接字。 I know that i'm looking for an AF_MAP socket which should be similar to a AF_UNIX socket.我知道我正在寻找一个AF_MAP套接字,它应该类似于AF_UNIX套接字。

How do i see what sockets are open, and once i find the one im looking for i need to see what information passes through.我如何查看哪些套接字是打开的,一旦我找到我正在寻找的套接字,我需要查看哪些信息通过。 how is this also done?这也是怎么做的? Thankyou谢谢

I'm not sure on FreeBSD specifically but you can use lsof in a way like:我不确定是否专门用于 FreeBSD,但您可以通过以下方式使用lsof

$ lsof -p $(pidof your-appname)

This will give you all the files it has opened.这将为您提供它已打开的所有文件。 For AF_UNIX sockets you may refer to this .对于AF_UNIX套接字,您可以参考这个

Also, you may want to use netstat -xa to see CONNECTED state sockets (if the application uses stream oriented sockets)此外,您可能希望使用netstat -xa查看CONNECTED状态套接字(如果应用程序使用面向流的套接字)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM