def __init__(self): ConnectionEventHandler.__init__(self) self.cfgs = {} self.accumulator = JsonDataAccumulator() self.conn = None self.session = None self.service = instance.serviceManager.get('main') self.mongo = instance.datasourceManager.get('mongodb').conn self.redis = instance.datasourceManager.get('redis').conn self.raw_file = None self.active = False # 设备是否在线登录 self.start_time = datetime.datetime.now() self.device_id = None self.redis = None self.device = None self.logger = None self.seq_gen = None # RedisIdGenerator().init('') self.packet_sequence = 0 self.device_app_pub_channel = None self.command_controller = None self.queue = Queue() self.running = True self.peer_address = '' self.last_heartbeat = 0 # self.msg_codec = MessageJsonStreamCodec() self.box = None self.device_type = '' self.joined = False # 是否已加入 self.subscribed_ids = {} # 已订阅设备编号 self.app_id = str(time.time())
def __init__(self): ConnectionEventHandler.__init__(self) self.conn = None self.accumulator = JsonDataAccumulator()
def __init__(self): ConnectionEventHandler.__init__(self) self.acc = None