From 9e62bf8d41ee3779b257d9a061ee658ecb7c3f06 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Mon, 14 Jul 2025 13:50:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=95=B0=E9=87=87=E5=81=9A=E6=88=90?= =?UTF-8?q?=E5=8D=95=E7=8B=AC=E6=9C=8D=E5=8A=A12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- out_service/cd.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/out_service/cd.py b/out_service/cd.py index 47ff7200..b50f8dc7 100644 --- a/out_service/cd.py +++ b/out_service/cd.py @@ -73,12 +73,12 @@ class JSONRequestHandler(BaseHTTPRequestHandler): def connect_and_send(): nonlocal sc sc = sc_all[addr] - if sc is None: - sc = socket.socket() - sc.settimeout(5) # 设置超时 - sc.connect((host, int(port))) - sc_all[f"{host}_{port}"] = sc try: + if sc is None: + sc = socket.socket() + sc.settimeout(5) # 设置超时 + sc.connect((host, int(port))) + sc_all[f"{host}_{port}"] = sc sc.sendall(b"R") except Exception as e: try: