I'm working on a proxy for linux(C++) that, amongst other functions, keeps track of tcp connections and associates them with the process's pid. To do that, I get the inode in /proc/net/tcp and then parse all procs in /proc/pid/fd to see which process contains it. Pretty straightforward.
Problem is, that sometimes clients are able to open and close the connection faster that the proxy is able to parse the processes' fds. I noticed this field - "location of socket in memory", which is present in /proc/net/tcp https://www.kernel.org/doc/Documentation/networking/proc_net_tcp.txt
and I wonder if it might be of any help, the whole thing is very poorly documented, and I did not find any resouce online related to it.
My questions are: what exactly is meant by location of socket memory, how can it be accessed, and what can I find there?
Thank you.