summaryrefslogtreecommitdiff
path: root/Doc/lib/libsocket.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/lib/libsocket.tex')
-rw-r--r--Doc/lib/libsocket.tex30
1 files changed, 25 insertions, 5 deletions
diff --git a/Doc/lib/libsocket.tex b/Doc/lib/libsocket.tex
index cc7bd759ac..c7b656d0ed 100644
--- a/Doc/lib/libsocket.tex
+++ b/Doc/lib/libsocket.tex
@@ -317,10 +317,11 @@ Availability: \UNIX. \versionadded{2.4}
\end{funcdesc}
\begin{funcdesc}{fromfd}{fd, family, type\optional{, proto}}
-Build a socket object from an existing file descriptor (an integer as
-returned by a file object's \method{fileno()} method). Address family,
-socket type and protocol number are as for the \function{socket()} function
-above. The file descriptor should refer to a socket, but this is not
+Duplicate the file descriptor \var{fd} (an integer as returned by a file
+object's \method{fileno()} method) and build a socket object from the
+result. Address family, socket type and protocol number are as for the
+\function{socket()} function above.
+The file descriptor should refer to a socket, but this is not
checked --- subsequent operations on the object may fail if the file
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
@@ -626,7 +627,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}
@@ -677,6 +678,25 @@ use \method{recv()} and \method{send()} without \var{flags} argument
instead.
+Socket objects also have these (read-only) attributes that correspond
+to the values given to the \class{socket} constructor.
+
+\begin{memberdesc}[socket]{family}
+The socket family.
+\versionadded{2.5}
+\end{memberdesc}
+
+\begin{memberdesc}[socket]{type}
+The socket type.
+\versionadded{2.5}
+\end{memberdesc}
+
+\begin{memberdesc}[socket]{proto}
+The socket protocol.
+\versionadded{2.5}
+\end{memberdesc}
+
+
\subsection{SSL Objects \label{ssl-objects}}
SSL objects have the following methods.