In Python 2.7 is there a way to get information on all open sockets similar to what netstat/ss does in linux?
I am interested in writing a small program (similar to EtherApe) that tracks when my computer opens a connection to a server.
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.
At least on Linux,
netstatworks by examining the data in procfs files such as/proc/net/tcp. There is, unfortunately, no OS-independent way of getting this data.