#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

@ -19,7 +19,7 @@ local plc = require("reactor-plc.plc")
local renderer = require("reactor-plc.renderer")
local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "v1.5.6"
local R_PLC_VERSION = "v1.5.7"
local println = util.println
local println_ts = util.println_ts

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

View File

@ -31,7 +31,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
local sps_rtu = require("rtu.dev.sps_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local RTU_VERSION = "v1.6.0"
local RTU_VERSION = "v1.6.1"
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE

View File

@ -93,8 +93,8 @@ function threads.thread__main(smem)
smem.q.mq_comms.push_packet(packet)
end
elseif event == "timer" and conn_watchdog.is_timer(param1) then
-- haven't heard from server recently? unlink
rtu_comms.unlink(rtu_state)
-- haven't heard from server recently? close connection
rtu_comms.close(rtu_state)
elseif event == "timer" then
-- notify timer callback dispatcher if no other timer case claimed this event
tcd.handle(param1)