Beispiel #1
0
 public static string StopRealPlay(string channelCode)
 {
     try
     {
         if (!dic_playProxy_media.ContainsKey(GetKeyGb(channelCode)))
         {
             return(channelCode + ":未找到");
         }
         dic_playProxy_media.Remove(GetKeyGb(channelCode));
         bool ret = MediaServer.mk_rtp_server_stop(channelCode);
         Console.WriteLine("停止收流接口:" + ret);
         if (ret)
         {
             if (RedisHelper.GetDatabase().HashExists("live", channelCode))
             {
                 bool ret1 = RedisHelper.GetDatabase().HashDelete("live", channelCode);
                 Console.WriteLine("删除" + channelCode + ":" + ret1);
             }
             else
             {
                 Console.WriteLine($"redis中未找到hash(live),HashFiled:{channelCode}");
             }
         }
         return(ret.ToString());
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
         Console.WriteLine(ex.StackTrace);
         return(false.ToString());
     }
 }