1

I'm developing a program in python that parses /proc/net/tcp informations, but unfortunately, while I was doing this, I saw a strange thing.

Practically, when a socket change in TIME_WAIT state, losses its inode number, and I don't know who is the owner of this socket.

I read some documents about this TIME_WAIT issue, and I understood that the connection is practically finished, and it remain in wait only to guarantee the data transfer.

Someone knows something about it?

  • Sockets don't change to TIME_WAIT state, connections (or endpoints) do. – David Schwartz Nov 23 '15 at 11:50
5

When the socket is in TIME_WAIT, there is no process attached to it anymore and the kernel is just holding it in case some other packet arrives. At this point, the software the originally opened this socket does not have a open file description to it anymore. That's why you can't find any relation to it. The socket that existed in /proc/$PID/fd is not there anymore.

2

A socket in TIME_WAIT status is no longer owned by a process, but by the kernel. As such, there is no owner, that's why you can't see it :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.