On this page
socket.send_fds
Prev: socket.recv_fds | Up: socket | Next: socket.setdefaulttimeout
Rel: socket.AddressFamily, socket.close, socket.create_connection, socket.create_server
Ref: docs.python.org — socket.send_fds
Tags: #public #python3 #stdlib #socket
Import
import socket
from socket import send_fds
Signature & Overview
socket.send_fds(sock, buffers, fds, flags=0, address=None)
Send the list of file descriptors fds over an AF_UNIX socket.
Usage
import socket
# Unix-only SCM_RIGHTS helper for passing open file descriptors between processes
assert hasattr(socket, "send_fds") or not hasattr(socket, "AF_UNIX")
Gotchas
- Unix domain sockets only: Must send at least 1 byte of normal payload alongside the descriptors.
REPL Inspect
from socket import send_fds
help(send_fds)
Linked from
Related notes
- tuts/python3/stdlib_module/socket/recv_fds Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/setdefaulttimeout Linked here; links to this page; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/AddressFamily Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/close Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/create_connection Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/create_server Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/socket Linked here; shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/socket/dup shared tags: #socket, #stdlib
- tuts/python3/stdlib_module/socket/error shared tags: #socket, #stdlib