def dup(self, SocketClass=None): if SocketClass is None: SocketClass = RSocket fd = _c.dup(self.fd) if fd < 0: raise self.error_handler() return make_socket(fd, self.family, self.type, self.proto, SocketClass=SocketClass)
def fromfd(fd, family, type, proto=0, SocketClass=RSocket): # Dup the fd so it and the socket can be closed independently fd = _c.dup(fd) if fd < 0: raise last_error() return make_socket(fd, family, type, proto, SocketClass)
def dup(fd): return _c.dup(fd)