protected override Task ExecuteAsync(CancellationToken stoppingToken) { JT1078MsgConsumer.OnMessage(async(Message) => { JT1078Package package = JT1078Serializer.Deserialize(Message.Data); var merge = JT1078.Protocol.JT1078Serializer.Merge(package); if (merge != null) { await messageDispatchDataService.HlsChannel.Writer.WriteAsync(merge); await messageDispatchDataService.FlvChannel.Writer.WriteAsync(merge); } }); return(Task.CompletedTask); }
protected override Task ExecuteAsync(CancellationToken stoppingToken) { MsgConsumer.OnMessage((Message) => { JT1078Package package = JT1078Serializer.Deserialize(Message.Data); var merge = JT1078.Protocol.JT1078Serializer.Merge(package); if (merge != null) { var hasHttpSessionn = HttpSessionManager.GetAllHttpContextBySimAndChannelNo(merge.SIM, merge.LogicChannelNumber); if (hasHttpSessionn.Count > 0) { M3U8FileManage.CreateTsData(merge); } else { M3U8FileManage.Clear(merge.SIM, merge.LogicChannelNumber); } } }); return(Task.CompletedTask); }