[IronPython] socket, _socket, and socket.py

Zachary Gramana zgramana at pottsconsultinggroup.com
Tue May 17 15:38:18 PDT 2011


I noticed this, with a little disappointment. I also noticed that they 
implemented a sort of ersatz/platform agnostic reference tracking system 
in ssl.py.  Seeing the _makefile_refs system got me thinking about the 
whole ssl.py/_ssl.pyd paradigm and sockets.cs, since I remembered you 
tackled this issue once before (or one very similar to it: 
http://lists.ironpython.com/pipermail/users-ironpython.com/2007-May/004946.html).

Perhaps something along the lines of _makefile_refs and 
GC.SuppressFinalize might get us closer?

On 5/17/2011 6:06 PM, Dino Viehland wrote:
> There is actually more of a story to this though – Cpython’s socket.py
> relies upon reference counting for handling dup.  See this comment from
> socket.py:
>
> # Wrapper around platform socket objects. This implements
>
> # a platform-independent dup() functionality. The
>
> # implementation currently relies on reference counting
>
> # to close the underlying socket object.
>
> class _socketobject(object):
>
> Because IronPython doesn’t have a reference counting GC we cannot simply
> use socket.py.  So someone would need to patch both IronPython and
> socket.py so this would work.  For the record it looks like Jython also
> has a custom socket.py.
>


More information about the Users mailing list