mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
RFE #567972: Socket objects' family, type and proto properties are
now exposed via new get...() methods.
This commit is contained in:
parent
5c170fd4a9
commit
bc45a3f821
5 changed files with 55 additions and 2 deletions
|
@ -626,7 +626,7 @@ timeouts on socket operations.
|
|||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[socket]{gettimeout}{}
|
||||
Returns the timeout in floating seconds associated with socket
|
||||
Return the timeout in floating seconds associated with socket
|
||||
operations, or \code{None} if no timeout is set. This reflects
|
||||
the last call to \method{setblocking()} or \method{settimeout()}.
|
||||
\versionadded{2.3}
|
||||
|
@ -654,6 +654,21 @@ Note that the \method{connect()} operation is subject to the timeout
|
|||
setting, and in general it is recommended to call
|
||||
\method{settimeout()} before calling \method{connect()}.
|
||||
|
||||
\begin{methoddesc}[socket]{getfamily}{}
|
||||
Return the socket family, as given to the \class{socket} constructor.
|
||||
\versionadded{2.5}
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[socket]{gettype}{}
|
||||
Return the socket type, as given to the \class{socket} constructor.
|
||||
\versionadded{2.5}
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[socket]{getproto}{}
|
||||
Return the socket protocol, as given to the \class{socket} constructor.
|
||||
\versionadded{2.5}
|
||||
\end{methoddesc}
|
||||
|
||||
\begin{methoddesc}[socket]{setsockopt}{level, optname, value}
|
||||
Set the value of the given socket option (see the \UNIX{} manual page
|
||||
\manpage{setsockopt}{2}). The needed symbolic constants are defined in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue