Feature Requests item #567972, was opened at 2002-06-12 13:56
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=567972&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Graham Horler (grahamh)
>Assigned to: Martin v. Löwis (loewis)
Summary: Missing 4 socket object properties

Initial Comment:
The C socketmodule has a struct PySocketSockObject, 
with family, type and proto members.

These would be terribly helpful to have access to in 
Python, when implementing some generic socket helper 
functions.

The "blocking" flag could also be made available, but 
would require some extra coding.

(I'm using Python 2.1.3 under Linux 2.4.16, so I cannot 
extend the socket class itself ((as in py2.2)), and don't 
want to slow down sockets with a complete wrapper, as I 
use them heavily.)

Thanks, Graham.

----------------------------------------------------------------------

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-07-17 15:49

Message:
Logged In: YES 
user_id=1188172

Attaching a patch which implements the three members of
_socket.socket.

Please review.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-06-15 15:21

Message:
Logged In: YES 
user_id=21627

Sounds good. Would you like to produce a patch implementing
this feature?

----------------------------------------------------------------------

Comment By: Graham Horler (grahamh)
Date: 2002-06-12 14:00

Message:
Logged In: YES 
user_id=543663

Oh yes, the repr of a socket object includes the missing info, 
so to get hold of the family, I go:
  int(repr(sock).split(' ')[3].split('=')[1][:-1])

Similar for type and protocol, not nice!


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=567972&group_id=5470
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to