From: Antoine Pitrou Date: Sun, 2 Jan 2011 22:06:53 +0000 (+0000) Subject: Clarify behaviour of close() and shutdown() on sockets. X-Git-Tag: v3.2rc1~246 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4a67a46543db0cec1a23106fa0bad9df5c351828;p=thirdparty%2FPython%2Fcpython.git Clarify behaviour of close() and shutdown() on sockets. --- diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 0a0f76420b37..c5f2b7c52266 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -552,6 +552,12 @@ correspond to Unix system calls applicable to sockets. remote end will receive no more data (after queued data is flushed). Sockets are automatically closed when they are garbage-collected. + .. note:: + :meth:`close()` releases the resource associated with a connection but + does not necessarily close the connection immediately. If you want + to close the connection in a timely fashion, call :meth:`shutdown()` + before :meth:`close()`. + .. method:: socket.connect(address)