hoe to build a patched socketmodule.c

Scott David Daniels Scott.Daniels at Acm.Org
Fri Jul 10 23:24:42 CEST 2009

jacopo mondi wrote:
> Roger Binns wrote:
>> jacopo mondi wrote:
>>> Hi all, I need to patch socketmodule.c (the _socket module) in order to
>>> add support to an experimental socket family.
>> You may find it considerably easier to use ctypes since that will avoid
>> the need for any patching.  You'll also be able to control how read and
>> write are done (eg read vs recvfrom vs recvmsg vs readv).  You can use
>> os.fdopen to convert your raw file descriptor into a Python file object
>> if appropriate.

The typical Python way of dealing with this is an additional module, not
a modified module placed back in the library.  So, take the sources and
edit, but change the module name.  Even better is figure out how to
use _socket.pyd, to create a smaller _socketexpmodule.c and use that.

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-list mailing list