[Python-Dev] sock.close() not closing? (original) (raw)
Sjoerd Mullender sjoerd at acm.org
Wed May 7 12:49:50 CEST 2008
- Previous message: [Python-Dev] #1858, looking for a reviewer
- Next message: [Python-Dev] sock.close() not closing?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Why does sock.close() not actually close sock?
If I run the code
import socket sock = socket.socket() ... sock.close()
I would expect that a system call is done to actually close the socket and free the file descriptor. But that does not happen. Look at the code in socket.py. It merely replaces the socket instance with a dummy instance so that all subsequent calls on the sock object fail, but it does nothing else!
-- Sjoerd Mullender
- Previous message: [Python-Dev] #1858, looking for a reviewer
- Next message: [Python-Dev] sock.close() not closing?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]