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)
| 538 | set_inheritable.__doc__ = "Set the inheritable flag of the socket" |
| 539 | |
| 540 | def fromfd(fd, family, type, proto=0): |
| 541 | """ fromfd(fd, family, type[, proto]) -> socket object |
| 542 | |
| 543 | Create a socket object from a duplicate of the given file |
| 544 | descriptor. The remaining arguments are the same as for socket(). |
| 545 | """ |
| 546 | nfd = dup(fd) |
| 547 | return socket(family, type, proto, nfd) |
| 548 | |
| 549 | if hasattr(_socket.socket, "sendmsg"): |
| 550 | import array |