This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients giampaolo.rodola, lcatucci, vstinner
Date 2008-12-02.00:05:07
SpamBayes Score 5.9165275e-05
Marked as misclassified No
Message-id <1228176308.9.0.615352990111.issue4473@psf.upfronthosting.co.za>
In-reply-to
Content
> 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 [1]:
"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 
socket.

You don't need to do that. The wrapper already calls shutdown() of the 
parent socket (see Lib/ssl.py).

[1] http://www.developerweb.net/forum/archive/index.php/t-2940.html
History
Date User Action Args
2008-12-02 00:05:08vstinnersetrecipients: + vstinner, giampaolo.rodola, lcatucci
2008-12-02 00:05:08vstinnersetmessageid: <1228176308.9.0.615352990111.issue4473@psf.upfronthosting.co.za>
2008-12-02 00:05:08vstinnerlinkissue4473 messages
2008-12-02 00:05:07vstinnercreate