mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
watchdog and timeout improvements
This commit is contained in:
parent
b2b53386d3
commit
84d8258701
2 changed files with 3 additions and 4 deletions
|
@ -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:
|
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)
|
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
|
static.ARQ_SEND_KEEP_ALIVE = True
|
||||||
else:
|
else:
|
||||||
# TODO: show time out message
|
# 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:
|
if static.ARQ_STATE == 'CONNECTED' and static.TNC_STATE == 'BUSY' and not static.ARQ_SEND_KEEP_ALIVE:
|
||||||
time.sleep(0.01)
|
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
|
static.ARQ_SEND_KEEP_ALIVE = False
|
||||||
#print("alles okay mit den daten....")
|
#print("alles okay mit den daten....")
|
||||||
else:
|
else:
|
||||||
|
|
3
sock.py
3
sock.py
|
@ -17,8 +17,6 @@ import data_handler
|
||||||
import helpers
|
import helpers
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
||||||
|
|
||||||
def handle(self):
|
def handle(self):
|
||||||
|
@ -99,6 +97,7 @@ class CMDTCPRequestHandler(socketserver.BaseRequestHandler):
|
||||||
static.TNC_STATE = 'BUSY'
|
static.TNC_STATE = 'BUSY'
|
||||||
asyncio.run(data_handler.arq_open_data_channel())
|
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:
|
if data.startswith('ARQ:DATA:') and static.ARQ_STATE == 'CONNECTED' and static.ARQ_READY_FOR_DATA == True:
|
||||||
|
|
||||||
static.TNC_STATE = 'BUSY'
|
static.TNC_STATE = 'BUSY'
|
||||||
|
|
Loading…
Reference in a new issue