示例#1
0
文件: rpc_test.py 项目: Nyrio/cms
    def handle_new_connection(self, socket_, address):
        """Create a new RemoteServiceServer to handle a new connection.

        Instantiate a RemoteServiceServer, add it to self.servers and
        have it listen on the given socket (which is for a connection
        opened by a remote host from the given address). This method
        will block until the socket gets closed.

        socket_ (socket): the socket to use
        address (tuple): the (ip address, port) of the remote part

        """
        server = RemoteServiceServer(self.service, address)
        self.servers.append(server)
        server.handle(socket_)
示例#2
0
    def handle_new_connection(self, socket_, address):
        """Create a new RemoteServiceServer to handle a new connection.

        Instantiate a RemoteServiceServer, add it to self.servers and
        have it listen on the given socket (which is for a connection
        opened by a remote host from the given address). This method
        will block until the socket gets closed.

        socket_ (socket): the socket to use
        address (tuple): the (ip address, port) of the remote part

        """
        server = RemoteServiceServer(self.service, address)
        self.servers.append(server)
        server.handle(socket_)
示例#3
0
文件: rpc_test.py 项目: artikz/cms
    def get_server(self, socket_, address):
        """Obtain a new RemoteServiceServer to handle a new connection.

        Instantiate a RemoteServiceServer, spawn its greenlet and add
        it to self.servers. It will listen on the given socket, that
        represents a connection opened by a remote host at the given
        address.

        socket_ (socket): the socket to use
        address (tuple): the (ip address, port) of the remote part
        return (RemoteServiceServer): a server

        """
        server = RemoteServiceServer(self.service, address)
        server.handle(socket_)
        self.servers.append(server)
        return server
示例#4
0
    def get_server(self, socket_, address):
        """Obtain a new RemoteServiceServer to handle a new connection.

        Instantiate a RemoteServiceServer, spawn its greenlet and add
        it to self.servers. It will listen on the given socket, that
        represents a connection opened by a remote host at the given
        address.

        socket_ (socket): the socket to use
        address (tuple): the (ip address, port) of the remote part
        return (RemoteServiceServer): a server

        """
        server = RemoteServiceServer(self.service, address)
        server.handle(socket_)
        self.servers.append(server)
        return server