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

Method closeRecvmsgFDs

Lib/test/test_socket.py:3961–3971  ·  view source on GitHub ↗
(self, recvmsg_result)

Source from the content-addressed store, hash-verified

3959 self.addCleanup(self.closeRecvmsgFDs, result)
3960
3961 def closeRecvmsgFDs(self, recvmsg_result):
3962 # Close all file descriptors specified in the ancillary data
3963 # of the given return value from recvmsg() or recvmsg_into().
3964 for cmsg_level, cmsg_type, cmsg_data in recvmsg_result[1]:
3965 if (cmsg_level == socket.SOL_SOCKET and
3966 cmsg_type == socket.SCM_RIGHTS):
3967 fds = array.array("i")
3968 fds.frombytes(cmsg_data[:
3969 len(cmsg_data) - (len(cmsg_data) % fds.itemsize)])
3970 for fd in fds:
3971 os.close(fd)
3972
3973 def createAndSendFDs(self, n):
3974 # Send n new file descriptors created by newFDs() to the

Callers

nothing calls this directly

Calls 3

lenFunction · 0.85
frombytesMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected