diff options
author | Saiyang Gou <gousaiyang@163.com> | 2021-04-22 04:08:46 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-22 04:08:46 (GMT) |
commit | 660592f67c0d825b06eb4a38ccc04b34a1f01f00 (patch) | |
tree | 7f6ab18d5f7b96c5559c4a3c50ff0b05b6f3b725 | |
parent | 37b173c5231b7b202859af97c17bc3d04b1e4c75 (diff) | |
download | cpython-660592f67c0d825b06eb4a38ccc04b34a1f01f00.zip cpython-660592f67c0d825b06eb4a38ccc04b34a1f01f00.tar.gz cpython-660592f67c0d825b06eb4a38ccc04b34a1f01f00.tar.bz2 |
bpo-28724: Doc: Move socket.send_fds and socket.recv_fds docs to right section (GH-22608)
-rwxr-xr-x | Doc/library/socket.rst | 49 | ||||
-rw-r--r-- | Doc/whatsnew/3.9.rst | 2 |
2 files changed, 27 insertions, 24 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 30b3c5e..8a1fc96 100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -1143,6 +1143,32 @@ The :mod:`socket` module also offers various network-related services: "Interface name" is a name as documented in :func:`if_nameindex`. +.. function:: send_fds(sock, buffers, fds[, flags[, address]]) + + Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket *sock*. + The *fds* parameter is a sequence of file descriptors. + Consult :meth:`sendmsg` for the documentation of these parameters. + + .. availability:: Unix supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` mechanism. + + .. versionadded:: 3.9 + + +.. function:: recv_fds(sock, bufsize, maxfds[, flags]) + + Receive up to *maxfds* file descriptors from an :const:`AF_UNIX` socket *sock*. + Return ``(msg, list(fds), flags, addr)``. + Consult :meth:`recvmsg` for the documentation of these parameters. + + .. availability:: Unix supporting :meth:`~socket.recvmsg` and :const:`SCM_RIGHTS` mechanism. + + .. versionadded:: 3.9 + + .. note:: + + Any truncated integers at the end of the list of file descriptors. + + .. _socket-objects: Socket Objects @@ -1637,29 +1663,6 @@ to sockets. .. versionadded:: 3.6 -.. method:: socket.send_fds(sock, buffers, fds[, flags[, address]]) - - Send the list of file descriptors *fds* over an :const:`AF_UNIX` socket. - The *fds* parameter is a sequence of file descriptors. - Consult :meth:`sendmsg` for the documentation of these parameters. - - .. availability:: Unix supporting :meth:`~socket.sendmsg` and :const:`SCM_RIGHTS` mechanism. - - .. versionadded:: 3.9 - -.. method:: socket.recv_fds(sock, bufsize, maxfds[, flags]) - - Receive up to *maxfds* file descriptors. Return ``(msg, list(fds), flags, addr)``. Consult - :meth:`recvmsg` for the documentation of these parameters. - - .. availability:: Unix supporting :meth:`~socket.recvmsg` and :const:`SCM_RIGHTS` mechanism. - - .. versionadded:: 3.9 - - .. note:: - - Any truncated integers at the end of the list of file descriptors. - .. method:: socket.sendfile(file, offset=0, count=None) Send a file until EOF is reached by using high-performance diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 174d9e2..602ed06 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -658,7 +658,7 @@ The socket module now supports the :data:`~socket.CAN_J1939` protocol on platforms that support it. (Contributed by Karl Ding in :issue:`40291`.) The socket module now has the :func:`socket.send_fds` and -:func:`socket.recv.fds` methods. (Contributed by Joannah Nanjekye, Shinya +:func:`socket.recv_fds` functions. (Contributed by Joannah Nanjekye, Shinya Okano and Victor Stinner in :issue:`28724`.) |