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
7095721d
Kaydet (Commit)
7095721d
authored
Şub 05, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Mention asyncore and Twisted in the library FAQ.
üst
11480b6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
library.rst
Doc/faq/library.rst
+8
-1
No files found.
Doc/faq/library.rst
Dosyayı görüntüle @
7095721d
...
@@ -757,7 +757,8 @@ some sample code::
...
@@ -757,7 +757,8 @@ some sample code::
How do I avoid blocking in the connect() method of a socket?
How do I avoid blocking in the connect() method of a socket?
------------------------------------------------------------
------------------------------------------------------------
The select module is commonly used to help with asynchronous I/O on sockets.
The :mod:`select` module is commonly used to help with asynchronous I/O on
sockets.
To prevent the TCP connect from blocking, you can set the socket to non-blocking
To prevent the TCP connect from blocking, you can set the socket to non-blocking
mode. Then when you do the ``connect()``, you will either connect immediately
mode. Then when you do the ``connect()``, you will either connect immediately
...
@@ -771,6 +772,12 @@ just return the errno value. To poll, you can call ``connect_ex()`` again later
...
@@ -771,6 +772,12 @@ just return the errno value. To poll, you can call ``connect_ex()`` again later
-- ``0`` or ``errno.EISCONN`` indicate that you're connected -- or you can pass this
-- ``0`` or ``errno.EISCONN`` indicate that you're connected -- or you can pass this
socket to select to check if it's writable.
socket to select to check if it's writable.
.. note::
The :mod:`asyncore` module presents a framework-like approach to the problem
of writing non-blocking networking code.
The third-party `Twisted <http://twistedmatrix.com/>`_ library is
a popular and feature-rich alternative.
Databases
Databases
=========
=========
...
...
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