Mercurial > cpython-lru_cache-weakref
diff Doc/lib/libsocket.tex @ 37372:42312e5f11fd 2.4
Bug #1460564: document that socket.fromfd() duplicates the given
file descriptor.
(backport from rev. 43523)
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Sat, 01 Apr 2006 07:33:22 +0000 |
| parents | 76d511972616 |
| children | 3473fcf0bcee |
line wrap: on
line diff
--- a/Doc/lib/libsocket.tex Sat Apr 01 07:23:12 2006 +0000 +++ b/Doc/lib/libsocket.tex Sat Apr 01 07:33:22 2006 +0000 @@ -314,10 +314,11 @@ \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
