I'm working on a proxy for Linux (C ++) that, among other functions, keeps track of TCP connections and associates them with the PID of the process. To do that, I get the inode in / proc / net / tcp and then I analyze all the processes in / proc / pid / fd to see which process contains it. Very clear.
The problem is that sometimes clients can open and close the connection faster than the proxy can analyze the fds of the processes. I noticed this field – "socket location in memory", which is present in / proc / net / tcp
and I wonder if it could be of any help, everything is very badly documented and I did not find any online resource related to it.
My questions are: what exactly is the location of the socket memory, how can it be accessed and what can I find there?