Is there a way to get a list of all open sockets ( socket address or socket descriptor ) in Linux using C in user-space or kernel?
Thank you
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Open and read the following:
/proc/net/tcp– a list of open TCP sockets/proc/net/udp– a list of open UDP sockets/proc/net/raw– a list all the “raw” socketsThese are like “regular” files that you open and read with a filehandle and will give you all the information you could possibly need about each socket.