feat: 数采做成单独服务2
This commit is contained in:
parent
3fe723b397
commit
9e62bf8d41
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue