Esempio n. 1
0
    def accept_w(self, space):
        """accept() -> (socket object, address info)

        Wait for an incoming connection.  Return a new socket representing the
        connection, and the address of the client.  For IP sockets, the address
        info is a pair (hostaddr, port).
        """
        try:
            fd, addr = self.accept()
            sock = rsocket.make_socket(
                fd, self.family, self.type, self.proto, W_RSocket)
            return space.newtuple([space.wrap(sock),
                                   addr_as_object(addr, sock.fd, space)])
        except SocketError, e:
            raise converted_error(space, e)
Esempio n. 2
0
    def accept_w(self, space):
        """accept() -> (socket object, address info)

        Wait for an incoming connection.  Return a new socket representing the
        connection, and the address of the client.  For IP sockets, the address
        info is a pair (hostaddr, port).
        """
        try:
            fd, addr = self.sock.accept()
            sock = rsocket.make_socket(
                fd, self.sock.family, self.sock.type, self.sock.proto)
            return space.newtuple([space.wrap(W_Socket(space, sock)),
                                   addr_as_object(addr, sock.fd, space)])
        except SocketError as e:
            raise converted_error(space, e)