watchdog and timeout improvements

This commit is contained in:
DJ2LS 2021-03-12 17:03:04 +01:00 committed by GitHub
parent b2b53386d3
commit 84d8258701
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -64,7 +64,7 @@ def connection_keep_alive_watchdog():
if static.ARQ_STATE == 'CONNECTED' and not static.ARQ_READY_FOR_DATA and static.TNC_STATE == 'IDLE' and static.ARQ_SEND_KEEP_ALIVE:
time.sleep(0.01)
if static.ARQ_CONNECTION_KEEP_ALIVE_RECEIVED + 20 > time.time():
if static.ARQ_CONNECTION_KEEP_ALIVE_RECEIVED + 10 > time.time():
static.ARQ_SEND_KEEP_ALIVE = True
else:
# TODO: show time out message
@ -83,7 +83,7 @@ def data_channel_keep_alive_watchdog():
if static.ARQ_STATE == 'CONNECTED' and static.TNC_STATE == 'BUSY' and not static.ARQ_SEND_KEEP_ALIVE:
time.sleep(0.01)
if static.ARQ_DATA_CHANNEL_LAST_RECEIVED + 20 > time.time():
if static.ARQ_DATA_CHANNEL_LAST_RECEIVED + 10 > time.time():
static.ARQ_SEND_KEEP_ALIVE = False
#print("alles okay mit den daten....")
else:

View file

@ -17,8 +17,6 @@ import data_handler
import helpers
class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
@ -98,6 +96,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
static.ARQ_READY_FOR_DATA = False
static.TNC_STATE = 'BUSY'
asyncio.run(data_handler.arq_open_data_channel())
if data.startswith('ARQ:DATA:') and static.ARQ_STATE == 'CONNECTED' and static.ARQ_READY_FOR_DATA == True: