Пример #1
0
    def __init__(self, ip, port, rpcService):
        super(ChannelClient, self).__init__()
        self.rpcService = rpcService
        self.ip = ip
        self.port = port
        self.logger = LogManager.getLogger('MarsRpc.ChannelClient')
        self.client = TcpClient(self.ip, self.port, self)
        self.status = ChannelClient.CS_INIT

        self.timer = None
        self.callback = None
Пример #2
0
    def __init__(self, rpcService, connector):
        super(RpcChannel, self).__init__()

        self.rpcService = rpcService # 将rpc请求传递给上层
        self.rpcRequest = MarsRequest.Request() # rpc请求的解析
        self.rpcRequestParser = MarsRequest.RequestParser()
        self.connector = connector # 底层网络连接
        self.connector.setChannelObj(self)
        self.controller = RpcController(self) # 传递channel给上层
        self.listeners = set()

        self.logger = LogManager.getLogger('MarsRpc.RpcChannel')
        self.logger.info('RpcChannel.__init__: an new connection')

        # user data
        self.userData = None
        self.encrypted = False
        self.compressed = False
        self.sessionSeed = None
Пример #3
0
 def __init__(self):
     super(RpcChannelManager, self).__init__()
     self.logger = LogManager.getLogger('MarsRpc.RpcChannelManager')
     self.rpcChannels = {}
Пример #4
0
 def __init__(self, rpcService, channelHandler, maxDataBytes=0):
     super(RpcChannelCreator, self).__init__()
     self.logger = LogManager.getLogger('MarsRpc.RpcChannelCreator')
     self.rpcService = rpcService
     self.channelHandler = channelHandler
     self.maxDataBytes = maxDataBytes