peerinfo:从连接到TCP套接字的本地对等方返回信息

时间:2021-04-03 23:53:08
【文件属性】:
文件名称:peerinfo:从连接到TCP套接字的本地对等方返回信息
文件大小:5KB
文件格式:ZIP
更新时间:2021-04-03 23:53:08
Go 对等信息 获取有关已连接的TCP套接字的过程的信息。 这样就可以使用不允许使用unix套接字的程序来执行通常使用unix套接字的工作。 顺便说一句,这都是qemu的错,请参阅 用法 调用peerinfo.Find将返回拥有本地计算机上给定套接字地址的进程的详细信息。 这是通过读取/proc文件来完成的,因此该库仅适用于linux。 import "github.com/KarpelesLab/peerinfo" func xxx ( c net. Conn ) { // remote and local are reversed as we want to remote side of the socket ci , err := peerinfo . Find ( c . RemoteAddr (), c . LocalAddr ()) // check err, etc
【文件预览】:
peerinfo-master
----clientinfo.go(957B)
----process.go(737B)
----LICENSE(1KB)
----parsehex.go(872B)
----proc.go(1KB)
----Makefile(95B)
----socket.go(2KB)
----README.md(812B)
----go.mod(48B)

网友评论