Move socket.send_fds and socket.recv_fds documentation to the "Other functions" section

This commit is contained in:
gousaiyang 2020-10-08 17:21:16 -07:00
parent 77f0a23e7a
commit 2c461f7159
1 changed files with 26 additions and 23 deletions

View File

@ -1120,6 +1120,32 @@ The :mod:`socket` module also offers various network-related services:
Windows support was added. Windows support was added.
.. function:: socket.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:: socket.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:
Socket Objects Socket Objects
@ -1614,29 +1640,6 @@ to sockets.
.. versionadded:: 3.6 .. 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) .. method:: socket.sendfile(file, offset=0, count=None)
Send a file until EOF is reached by using high-performance Send a file until EOF is reached by using high-performance