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?
If you don't want to copy/paste or reimplement chunks of the lsof code, and it doesn't build any useful libraries you could leverage, you can still open a pipe to an lsof process and peruse its output.