套接字未在 lsof 中列出,但在 netstat 中列出
当我执行“lsof -nl |egrep“TCP|UDP””以查看套接字状态时,我注意到我期望列出的套接字根本不存在,但是当我执行“netstat --tcp”时,它们已列出,但处于 CLOSE_WAIT 状态。
到目前为止我所知道的是,CLOSE_WAIT 状态表示我的应用程序现在有责任显式关闭此套接字(但我正在尝试追踪一个错误,该错误使此套接字保持在 CLOSE_WAIT 状态)。我认为如果一个套接字存在,那么它必须有一个与之关联的打开文件描述符,所以我希望在 lsof 的输出中看到它。为什么我在那里看不到它?
谢谢, 桑德拉
When I do "lsof -nl | egrep "TCP|UDP" " in order to see socket states, I notice that the sockets that I expected to be listed are not at all, but when I do a "netstat --tcp", they are listed, but are in a CLOSE_WAIT state.
What I know so far is that the CLOSE_WAIT state signifies that my application has a responsibility now to explicitly close this socket (but there is a bug that I'm trying to track down, which keeps this socket in a CLOSE_WAIT state). I thought that if a socket exists, then it must have an open file descriptor associated with it, so I expected to see it on the output of lsof. Why is it that I couldn't see it there?
Thanks,
Sandra
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你有足够的权限吗? (我认为这属于超级用户)
Do you have enough permissions? (And I think this belongs to superuser)