MCPcopy Index your code
hub / github.com/RustPython/RustPython / sendfds

Function sendfds

Lib/multiprocessing/reduction.py:145–151  ·  view source on GitHub ↗

Send an array of fds over an AF_UNIX socket.

(sock, fds)

Source from the content-addressed store, hash-verified

143 ACKNOWLEDGE = sys.platform == 'darwin'
144
145 def sendfds(sock, fds):
146 '''Send an array of fds over an AF_UNIX socket.'''
147 fds = array.array('i', fds)
148 msg = bytes([len(fds) % 256])
149 sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)])
150 if ACKNOWLEDGE and sock.recv(1) != b'A':
151 raise RuntimeError('did not receive acknowledgement of fd')
152
153 def recvfds(sock, size):
154 '''Receive an array of fds over an AF_UNIX socket.'''

Callers 1

send_handleFunction · 0.85

Calls 3

lenFunction · 0.85
sendmsgMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected