See socket options on existing sockets created by other apps?
- by nailer
I'd like to test whether particular socket options have been set on an existing socket. Ie, pretty much everything you can see in:
#!/usr/bin/env python
'''See possible TCP socket options'''
import socket
sockettypelist = [x for x in dir(socket) if x.startswith('SO_')]
sockettypelist.sort()
for sockettype in sockettypelist:
print sockettype
Anyone know how I can see the options on existing sockets, ie those created by other processes? Alas nearly all the documentation I read on Python socket programming is about making new sockets.