初级的功能
This commit is contained in:
@@ -3,6 +3,7 @@ using FATrace.HKNetLib.Hardware;
|
||||
using FATrace.Model;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.IO;
|
||||
using static FATrace.HKNetLib.Hardware.CHCNetSDK;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -445,15 +446,17 @@ namespace FATrace.HKNetLib.Wrapper
|
||||
{
|
||||
// 发生错误,尝试停止下载并退出
|
||||
Sdk_NET_DVR_StopGetFile();
|
||||
try { NVRLoadVideoCompleteEventHandler?.Invoke(this, "下载失败"); } catch { }
|
||||
break;
|
||||
}
|
||||
|
||||
try { await Task.Delay(_downloadPollIntervalMs, token); } catch { /* ignore */ }
|
||||
}
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 轮询线程异常吞掉,避免影响上层逻辑
|
||||
try { NVRLoadVideoCompleteEventHandler?.Invoke(this, $"下载失败:{ex.Message}"); } catch { }
|
||||
}
|
||||
}, token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user