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
fc9823b1
Kaydet (Commit)
fc9823b1
authored
Haz 07, 2002
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Clarify the interaction between blocking and timeouts. Explain that
fromfd() assumes a blocking non-timeout socket.
üst
e8008f00
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
16 deletions
+23
-16
libsocket.tex
Doc/lib/libsocket.tex
+23
-16
No files found.
Doc/lib/libsocket.tex
Dosyayı görüntüle @
fc9823b1
...
@@ -284,7 +284,8 @@ checked --- subsequent operations on the object may fail if the file
...
@@ -284,7 +284,8 @@ checked --- subsequent operations on the object may fail if the file
descriptor is invalid. This function is rarely needed, but can be
descriptor is invalid. This function is rarely needed, but can be
used to get or set socket options on a socket passed to a program as
used to get or set socket options on a socket passed to a program as
standard input or output (such as a server started by the
\UNIX
{}
inet
standard input or output (such as a server started by the
\UNIX
{}
inet
daemon).
daemon). The socket is assumed to be created in blocking mode without
a timeout.
Availability:
\UNIX
.
Availability:
\UNIX
.
\end{funcdesc}
\end{funcdesc}
...
@@ -515,29 +516,35 @@ block until they can proceed.
...
@@ -515,29 +516,35 @@ block until they can proceed.
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[socket]
{
settimeout
}{
value
}
\begin{methoddesc}
[socket]
{
settimeout
}{
value
}
Set a timeout on blocking socket operations. Value can be any numeric
Set a timeout on blocking socket operations. Value can be a
value or
\code
{
None
}
. Socket operations will raise an
nonnegative float expressing seconds, or
\code
{
None
}
. If a float is
\exception
{
error
}
exception if the timeout period
\var
{
value
}
has
give, subsequent socket operations will raise an
\exception
{
error
}
elapsed before the operation has completed. Setting a timeout of
exception if the timeout period
\var
{
value
}
has elapsed before the
\code
{
None
}
disables timeouts on socket operations.
operation has completed. Setting a timeout of
\code
{
None
}
disables
timeouts on socket operations.
\versionadded
{
2.3
}
\versionadded
{
2.3
}
\end{methoddesc}
\end{methoddesc}
\begin{methoddesc}
[socket]
{
gettimeout
}{}
\begin{methoddesc}
[socket]
{
gettimeout
}{}
Returns the timeout in floating seconds associated with socket
Returns the timeout in floating seconds associated with socket
operations. A timeout of
\code
{
None
}
indicates that timeouts on
operations, or
\code
{
None
}
if no timeout is set.
socket operations are disabled.
\versionadded
{
2.3
}
\versionadded
{
2.3
}
\end{methoddesc}
\end{methoddesc}
Some notes on the interaction between socket blocking and timeouts:
Some notes on the interaction between socket blocking and timeouts: A
socket blocking mode takes precedence over timeouts. If a socket is
socket object can be in one of three modes: blocking, non-blocking, or
set to non-blocking mode, then timeouts are not used.
timout. Sockets are always created in blocking mode. In blocking
The timeout value associated with the socket can still be set using
mode, operations block until complete. In non-blocking mode,
\method
{
settimeout()
}
and its value retrieved using
operations fail (with an error that is unfortunately system-dependent)
\method
{
gettimeout()
}
, but the timeout is never enforced (an exception
if they cannot be completed immediately. In timeout mode, operations
will never be thrown). Otherwise, if the socket is in blocking mode,
fail if they cannot be completed within the timeout specified for the
setting the timeout will raise an exception as expected.
socket.
Calling
\method
{
settimeout()
}
cancels non-blocking mode as set by
\method
{
setblocking()
}
; calling
\method
{
setblocking()
}
cancels a
previously set timeout. Setting the timeout to zero acts similarly
but is implemented different than setting the socket in non-blocking
mode (this could be considered a bug and may even be fixed).
\begin{methoddesc}
[socket]
{
setsockopt
}{
level, optname, value
}
\begin{methoddesc}
[socket]
{
setsockopt
}{
level, optname, value
}
Set the value of the given socket option (see the
\UNIX
{}
manual page
Set the value of the given socket option (see the
\UNIX
{}
manual page
...
...
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