MCPcopy Index your code
hub / github.com/python/cpython / fromfd

Function fromfd

Lib/socket.py:557–564  ·  view source on GitHub ↗

fromfd(fd, family, type[, proto]) -> socket object Create a socket object from a duplicate of the given file descriptor. The remaining arguments are the same as for socket().

(fd, family, type, proto=0)

Source from the content-addressed store, hash-verified

555 set_inheritable.__doc__ = "Set the inheritable flag of the socket"
556
557def fromfd(fd, family, type, proto=0):
558 """ fromfd(fd, family, type[, proto]) -> socket object
559
560 Create a socket object from a duplicate of the given file
561 descriptor. The remaining arguments are the same as for socket().
562 """
563 nfd = dup(fd)
564 return socket(family, type, proto, nfd)
565
566if hasattr(_socket.socket, "sendmsg"):
567 def send_fds(sock, buffers, fds, flags=0, address=None):

Callers

nothing calls this directly

Calls 1

socketClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…