[Tutor] question about socket status

Rupp, Romaine Romaine.Rupp at arrisi.com
Mon Jul 21 19:25:10 CEST 2008


Hello,
I am new to programming with python and sockets.
I would like to determine the status of a socket as it  is returned when you do 'netstat -a | grep <port#>'.  I would like  to know if the socket state is ESTABLISHED, LISTEN , CLOSE_WAIT, etc.
Is there a way to get this information through a socket call?
I've tried using socket.getperrname() function, but that only tells if there is a connection.
Is there a way to get more information on the state of the socket connection?
Thanks,
rrupp
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080721/fb438b3b/attachment.htm>


More information about the Tutor mailing list