|
|
|
@ -20,7 +20,7 @@ namespace AksWebBrowser.Common
|
|
|
|
|
private readonly string _serverUri; |
|
|
|
|
private readonly ClientWebSocket _webSocket = new ClientWebSocket(); |
|
|
|
|
public string funName = string.Empty; |
|
|
|
|
public bool isstop = true; |
|
|
|
|
public bool isstop = true; |
|
|
|
|
//开启定时 |
|
|
|
|
System.Timers.Timer timer = new System.Timers.Timer(30000); |
|
|
|
|
public WebSocketClientWithHeartbeat() |
|
|
|
@ -66,7 +66,27 @@ namespace AksWebBrowser.Common
|
|
|
|
|
{ |
|
|
|
|
JObject jo = (JObject)JsonConvert.DeserializeObject(body); |
|
|
|
|
string functionName = jo["functionName"].ToString(); |
|
|
|
|
if (functionName == "LiveDetectResult") |
|
|
|
|
if (functionName == "CF_OpenCamera") |
|
|
|
|
{ |
|
|
|
|
string status = jo["success"].ToString(); |
|
|
|
|
if (status == "0") |
|
|
|
|
{ |
|
|
|
|
//开始活检 |
|
|
|
|
Send("{\"function\":\"CF_StartLiveDetect\"}", "CF_StartLiveDetect"); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
timer.Stop(); |
|
|
|
|
// 断开连接 |
|
|
|
|
_webSocket.Dispose(); |
|
|
|
|
isstop = false; |
|
|
|
|
string commod = "cd /opt/lhtserver/files/bin && nohup ./LhtCamServer.sh &"; |
|
|
|
|
MainModel.Bash(commod); |
|
|
|
|
Task.Delay(1000).Wait(); |
|
|
|
|
MainModel.StartFace(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (functionName == "LiveDetectResult") |
|
|
|
|
{ |
|
|
|
|
Log.Error("LiveDetectResult" + "活检准备"); |
|
|
|
|
string status = string.Empty; |
|
|
|
|