diff --git a/CPF_Cef/Common/TcpClients.cs b/CPF_Cef/Common/TcpClients.cs index 5bc3f19..1ef9f3d 100644 --- a/CPF_Cef/Common/TcpClients.cs +++ b/CPF_Cef/Common/TcpClients.cs @@ -116,6 +116,7 @@ namespace AksWebBrowser.Common { try { + int timeout = 0; byte[] messageBytes = Encoding.UTF8.GetBytes(message); byte[] header = BitConverter.GetBytes(messageBytes.Length); byte[] data = new byte[header.Length + messageBytes.Length]; @@ -126,6 +127,11 @@ namespace AksWebBrowser.Common while (string.IsNullOrEmpty(jsonstr) && Parame.tcpClient != null) { Task.Delay(10).Wait(); + timeout = timeout + 10; + if (timeout > 5000) + { + jsonstr = MainModel.str2Base64("{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "获取数据超时!" + "\"}"); + } } if (string.IsNullOrEmpty(jsonstr)) {