diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs index 4aaf694..ed342bd 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/InterfaceDocking/HttpResponse.cs @@ -31,6 +31,7 @@ namespace Mesnac.Action.ChemicalWeighing.InterfaceDocking { HttpItem item = new HttpItem() { + Timeout = 5, URL = url, //URL 必需项 Method = "post",//URL 可选项 默认为Get ContentType = "application/json",//返回类型 可选项有默认值 diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs index c67b74c..ac1fd3e 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/ManualControl/InitAction.cs @@ -18,7 +18,9 @@ using System.Data; using System.IO; using System.Linq; using System.Text; +using System.Threading; using System.Windows.Forms; +using Timer = System.Windows.Forms.Timer; namespace Mesnac.Action.ChemicalWeighing.ManualControl { @@ -196,11 +198,18 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl deviceNo = deviceNo.ToString(), state = statu.ToString(), }; - HttpResponse httpResponse = new HttpResponse(); - // MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}下发请求"); - string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity); - // ManualLogControl($"湿混机{deviceNo}返回数据 " + returnTest); - MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}返回数据" + returnTest); + + //即使网络不同 也不会影响上位机的使用 + ThreadPool.QueueUserWorkItem(delegate + { + HttpResponse httpResponse = new HttpResponse(); + // MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}下发请求"); + string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity); + // ManualLogControl($"湿混机{deviceNo}返回数据 " + returnTest); + MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}返回数据" + returnTest); + }); + + }