Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Slightly OT: detecting the socket type of a descriptor

Reply
Thread Tools

Slightly OT: detecting the socket type of a descriptor

 
 
Heiko Wundram
Guest
Posts: n/a
 
      01-04-2006
Hi all!

I'm currently in the process of implementing SCM_RIGHTS support for Python
in the socket module, and I'm stuck at wrapping socket descriptors in an
appropriate socket object.

The problem boils down to the fact that I can test for the type of a file
descriptor being a socket, but after I know that it's a socket I can't seem
to test for the address and/or protocol family, which is kinda important to
create the appropriate Python socket object. (for files, creating an
appropriate python file object is easier, as the file open type can be
gotten from the stat structure)

Anyway, is there a way to reliably detect this? Thanks for any insight!

btw. if you're interested in the socket module's extension, have a look at

http://svn.asta.mh-hannover.de/asta/...socketmodule.c

for the complete bowels of the enhanced _socket module implementation,
especially the recvmsg() function.

--- Heiko.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Steve Holden Python 0 02-01-2009 12:45 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 0 02-01-2009 07:37 AM
socket.unbind or socket.unlisten? - socket.error: (48, 'Addressalready in use') Laszlo Nagy Python 1 01-27-2009 05:05 PM
Re: socket.unbind or socket.unlisten? - socket.error: (48,'Address already in use') Jean-Paul Calderone Python 0 01-27-2009 01:41 PM
[socket] test socket descriptor state mbm C Programming 2 09-27-2007 02:48 PM



Advertisments