diff options
author | Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> | 2019-09-11 17:12:21 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-09-11 17:12:21 (GMT) |
commit | 8d120f75fb8c8731464b5f7531d74cdbb897d924 (patch) | |
tree | 83556ba3290273801d5cc0d54d65851ecad96740 /Doc/library/socket.rst | |
parent | 58ab13479d854491ac9207bacfae25e8b18b044a (diff) | |
download | cpython-8d120f75fb8c8731464b5f7531d74cdbb897d924.zip cpython-8d120f75fb8c8731464b5f7531d74cdbb897d924.tar.gz cpython-8d120f75fb8c8731464b5f7531d74cdbb897d924.tar.bz2 |
bpo-28724: Add methods send_fds and recv_fds to the socket module (GH-12889)
The socket module now has the socket.send_fds() and socket.recv.fds() functions.
Contributed by Joannah Nanjekye, Shinya Okano (original patch)
and Victor Stinner.
Co-Authored-By: Victor Stinner <vstinner@redhat.com>
Diffstat (limited to 'Doc/library/socket.rst')
-rwxr-xr-x[-rw-r--r--] | Doc/library/socket.rst | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index eebbe81..d443e97 100644..100755 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -1584,6 +1584,29 @@ 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 |