Is there any way to get all opened sockets using c++? I know the lsof command and this is what I\'m looking for, but how to use it in a c++ application?
lsof
Just open the files in /proc/net, like /proc/net/tcp, /proc/net/udp, etc. No need to slog through the lsof sources. :)