Re: [Python-Dev] socket._socketobject.close() doesn't really close sockets

2006-06-12 Thread Guido van Rossum
Yes, this is because of the (unfortunate) availability of the dup() operation. Originally, dup() was only available on Unix, where it's implemented in the kernel at the file descriptor level: when several file descriptors all share the same underlying socket, the socket isn't really closed until th

[Python-Dev] socket._socketobject.close() doesn't really close sockets

2006-06-12 Thread Bruce Christensen
In implementing the IronPython _socket module, I've discovered some puzzling behavior in the standard Python socket wrapper module: socket._socketobject.close() doesn't actually close sockets; rather, it just sets _sock to an instance of _closedsocket and lets the GC clean up the real socket. (See