#327 close connections on timeout

This commit is contained in:
Mikayla Fischler
2023-08-25 21:42:35 -04:00
parent 8b0a5d529e
commit b7d4468cea
4 changed files with 6 additions and 6 deletions

View File

@@ -154,8 +154,8 @@ function threads.thread__main(smem, init)
smem.q.mq_comms_rx.push_packet(packet)
end
elseif event == "timer" and networked and plc_state.init_ok and conn_watchdog.is_timer(param1) then
-- haven't heard from server recently? shutdown reactor
plc_comms.unlink()
-- haven't heard from server recently? close connection and shutdown reactor
plc_comms.close()
smem.q.mq_rps.push_command(MQ__RPS_CMD.TRIP_TIMEOUT)
elseif event == "timer" then
-- notify timer callback dispatcher if no other timer case claimed this event