Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e3658a70
Kaydet (Commit)
e3658a70
authored
Ara 04, 2013
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #19882: tweak docs for socket.close()
üst
abbc8ca7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
socket.rst
Doc/library/socket.rst
+19
-9
No files found.
Doc/library/socket.rst
Dosyayı görüntüle @
e3658a70
...
...
@@ -701,8 +701,9 @@ The module :mod:`socket` exports the following constants and functions:
Socket Objects
--------------
Socket objects have the following methods. Except for :meth:`makefile` these
correspond to Unix system calls applicable to sockets.
Socket objects have the following methods. Except for
:meth:`~socket.makefile`, these correspond to Unix system calls applicable
to sockets.
.. method:: socket.accept()
...
...
@@ -721,9 +722,15 @@ correspond to Unix system calls applicable to sockets.
.. method:: socket.close()
Close the socket. All future operations on the socket object will fail. The
remote end will receive no more data (after queued data is flushed). Sockets are
automatically closed when they are garbage-collected.
Mark the socket closed. The underlying system resource (e.g. a file
descriptor) is also closed when all file objects from :meth:`makefile()`
are closed. Once that happens, all future operations on the socket
object will fail. The remote end will receive no more data (after
queued data is flushed).
Sockets are automatically closed when they are garbage-collected, but
it is recommended to :meth:`close` them explicitly, or to use a
:keyword:`with` statement around them.
.. note::
:meth:`close()` releases the resource associated with a connection but
...
...
@@ -829,10 +836,13 @@ correspond to Unix system calls applicable to sockets.
type depends on the arguments given to :meth:`makefile`. These arguments are
interpreted the same way as by the built-in :func:`open` function.
Closing the file object won't close the socket unless there are no remaining
references to the socket. The socket must be in blocking mode; it can have
a timeout, but the file object's internal buffer may end up in a inconsistent
state if a timeout occurs.
The socket must be in blocking mode; it can have a timeout, but the file
object's internal buffer may end up in a inconsistent state if a timeout
occurs.
Closing the file object returned by :meth:`makefile` won't close the
original socket unless all other file objects have been closed and
:meth:`socket.close` has been called on the socket object.
.. note::
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment