feat: 数采做成单独服务2

This commit is contained in:
caoqianming 2025-07-14 13:50:50 +08:00
parent 3fe723b397
commit 9e62bf8d41
1 changed files with 5 additions and 5 deletions

View File

@ -73,12 +73,12 @@ class JSONRequestHandler(BaseHTTPRequestHandler):
def connect_and_send(): def connect_and_send():
nonlocal sc nonlocal sc
sc = sc_all[addr] 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: 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") sc.sendall(b"R")
except Exception as e: except Exception as e:
try: try: