发现连接断开后再连接有可能连不上的问题
添加一些打印
This commit is contained in:
@@ -41,6 +41,7 @@ def send_to(ip,port,data:bytearray):
|
||||
def close(ip,port):
|
||||
for item in _local_client:
|
||||
if(item[1]==ip and item[2]==port):
|
||||
print(f"remote close:{ip},{port}")
|
||||
item[0].close()
|
||||
break
|
||||
|
||||
@@ -57,7 +58,7 @@ def local_client_handler(tcp_server:socket,ip,port):
|
||||
try:
|
||||
recv = tcp_server.recv(4096)
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
print("local:",str(e))
|
||||
break
|
||||
if recv:
|
||||
cmd={'device':'server','option':'data','ip':ip,'port':port}
|
||||
@@ -91,7 +92,7 @@ def remote_client_handler(tcp_client_1:socket):
|
||||
try:
|
||||
recv = tcp_client_1.recv(4096)
|
||||
except Exception as e:
|
||||
print(str(e))
|
||||
print("remote:",str(e))
|
||||
break
|
||||
if recv:
|
||||
recv_data+=recv
|
||||
|
Reference in New Issue
Block a user