[issue4473] POP3 missing support for starttls
report at bugs.python.org
Tue Dec 2 01:05:08 CET 2008
STINNER Victor <victor.stinner at haypocalc.com> added the comment:
> As for the shutdown before close, it's needed to let the server know
> we are leaving, instead of waiting until socket timeout.
Extracts of an UNIX FAQ :
"Generally the difference between close() and shutdown() is: close()
closes the socket id for the process but the connection is still
opened if another process shares this socket id."
"i have noticed on some (mostly non-unix) operating systems though a
close by all processes (threads) is not enough to correctly flush
data, (or threads) is not. A shutdown must be done, but on many
systems it is superfulous."
So shutdown() is useless on most OS, but it looks like it's better to
use it ;-)
> This is the reason I need to keep the reference to the wrapped
You don't need to do that. The wrapper already calls shutdown() of the
parent socket (see Lib/ssl.py).
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list