コード例 #1
0
ファイル: rpc_server.py プロジェクト: CN-UPB/netSLS
 def serve_forever(self):
     """Starts the RPC server and serves forever."""
     logger.info("RPC server started listening on 0.0.0.0:{}".format(
         configuration.get_rpc_server_port()))
     try:
         self.__server.serve_forever()
     except gevent.hub.LoopExit:
         # FIXME: Right now this exception seems to be expected in this situation. Maybe have another look...
         pass
コード例 #2
0
 def serve_forever(self):
     """Starts the RPC server and serves forever."""
     logger.info("RPC server started listening on 0.0.0.0:{}".format(
         configuration.get_rpc_server_port()))
     try:
         self.__server.serve_forever()
     except gevent.hub.LoopExit:
         # FIXME: Right now this exception seems to be expected in this situation. Maybe have another look...
         pass
コード例 #3
0
    def __init__(self, interface):
        """
        Args:
            interface: Interface to provide.
        """
        self.__dispatcher = RPCLoggingDispatcher()
        transport = WsgiServerTransport(queue_class=gevent.queue.Queue)

        self._wsgi_server = gevent.wsgi.WSGIServer(
            ('', configuration.get_rpc_server_port()),
            transport.handle,
            log=None)
        gevent.spawn(self._wsgi_server.serve_forever)

        self.__server = RPCServerGreenlets(transport, JSONRPCProtocol(),
                                           self.__dispatcher)

        # register interface's public functions
        self.__dispatcher.register_instance(interface, "")
コード例 #4
0
ファイル: rpc_server.py プロジェクト: CN-UPB/netSLS
    def __init__(self, interface):
        """
        Args:
            interface: Interface to provide.
        """
        self.__dispatcher = RPCLoggingDispatcher()
        transport = WsgiServerTransport(queue_class=gevent.queue.Queue)

        self._wsgi_server = gevent.wsgi.WSGIServer(
            ('', configuration.get_rpc_server_port()),
            transport.handle,
            log=None)
        gevent.spawn(self._wsgi_server.serve_forever)

        self.__server = RPCServerGreenlets(
            transport,
            JSONRPCProtocol(),
            self.__dispatcher
        )

        # register interface's public functions
        self.__dispatcher.register_instance(interface, "")