Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)