#41 cancel session watchdog timer

This commit is contained in:
Mikayla Fischler 2022-05-02 11:44:10 -04:00
parent 76c81395b7
commit b280201446
2 changed files with 7 additions and 0 deletions

View File

@ -81,6 +81,12 @@ function new_watchdog(timeout)
self._wd_timer = os.startTimer(self._timeout)
end
local cancel = function ()
if self._wd_timer ~= nil then
os.cancelTimer(self._wd_timer)
end
end
return {
get_timer = get_timer,
feed = feed

View File

@ -365,6 +365,7 @@ function new_session(id, for_reactor, in_queue, out_queue)
-- close the connection
local close = function ()
self.plc_conn_watchdod.cancel()
self.connected = false
_send_mgmt(SCADA_MGMT_TYPES.CLOSE, {})
end