套接字描述符泄漏 - lsof无法识别协议?

时间:2012-01-16 06:34:15

标签: sockets lsof

运行命令/usr/sbin/lsof -p 20085时,什么是“无法识别协议”。 lsof的输出如下所示

leak 20085 niki 3910u  sock        0,5            2457507716 can't identify protocol
leak 20085 niki 3911u  sock        0,5            2457508136 can't identify protocol
leak 20085 niki 3912u  sock        0,5            2457509392 can't identify protocol
leak 20085 niki 3913u  sock        0,5            2457510457 can't identify protocol
leak 20085 niki 3915u  sock        0,5            2457510696 can't identify protocol
leak 20085 niki 3916u  sock        0,5            2457511180 can't identify protocol
leak 20085 niki 3917u  sock        0,5            2457511820 can't identify protocol
leak 20085 niki 3918u  sock        0,5            2457512402 can't identify protocol
leak 20085 niki 3919u  sock        0,5            2457513490 can't identify protocol
leak 20085 niki 3920u  sock        0,5            2457513493 can't identify protocol
leak 20085 niki 3921u  sock        0,5            2457643983 can't identify protocol
leak 20085 niki 3922u  sock        0,5            2457645099 can't identify protocol
leak 20085 niki 3923u  sock        0,5            2457645570 can't identify protocol
leak 20085 niki 3924u  sock        0,5            2457646223 can't identify protocol
leak 20085 niki 3911u  sock        0,5            2457508136 can't identify protocol
leak 20085 niki 3912u  sock        0,5            2457509392 can't identify protocol

为什么这个泄漏总是被袜子0,5。

注意:我正在创建三个套接字,必须始终在运行时打开,除此之外没有创建文件/套接字,我的问题是我得到5000左右无法识别协议。为什么会这样?

感谢。

1 个答案:

答案 0 :(得分:2)

您可能正在函数调用中创建套接字,该套接字在循环中调用,但创建的套接字永远不会关闭,这会导致泄漏。