Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4a67a46

Browse files
committed
Clarify behaviour of close() and shutdown() on sockets.
1 parent abcfcba commit 4a67a46

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Doc/library/socket.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,12 @@ correspond to Unix system calls applicable to sockets.
552552
remote end will receive no more data (after queued data is flushed). Sockets are
553553
automatically closed when they are garbage-collected.
554554

555+
.. note::
556+
:meth:`close()` releases the resource associated with a connection but
557+
does not necessarily close the connection immediately. If you want
558+
to close the connection in a timely fashion, call :meth:`shutdown()`
559+
before :meth:`close()`.
560+
555561

556562
.. method:: socket.connect(address)
557563

0 commit comments

Comments
 (0)