Newbie question: SOLVED (how to keep a socket listening), but still some questions

Jp Calderone exarkun at divmod.com
Fri Jun 24 21:42:48 EDT 2005


On Sat, 25 Jun 2005 01:36:56 -0000, Grant Edwards <grante at visi.com> wrote:
>On 2005-06-25, Giovanni Tumiati <giovanni at poseidon.home.net> wrote:
>
>> (2)Does one have to do a socket.shutdown() before one does a
>> socket.close??
>
>No.
>
>[I've never figured out why one would do a shutdown RDWR
>rather than close the connection, but I haven't put a lot of
>thought into it.]

shutdown actually tears down the TCP connection; close releases the file descriptor.

If there is only one file descriptor referring to the TCP connection, these are more or less the same.  If there is more than one file descriptor, though, the difference should be apparent.

Jp



More information about the Python-list mailing list