From d5060809374c89f6764f535489e0619e42555070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=BD=87=E9=98=B3?= Date: Wed, 22 May 2024 17:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=8E=B7=E5=8F=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=B6=85=E6=97=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPF_Cef/Common/TcpClients.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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)) {