From a7b2d2c0124446cf250d3f52e5a1021190a5b820 Mon Sep 17 00:00:00 2001 From: Izaya Date: Wed, 25 Jul 2018 11:56:10 +1000 Subject: [PATCH] add variable for amount of retries for #6 --- OpenOS/etc/rc.d/minitel.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/OpenOS/etc/rc.d/minitel.lua b/OpenOS/etc/rc.d/minitel.lua index e26d183..7f000ed 100644 --- a/OpenOS/etc/rc.d/minitel.lua +++ b/OpenOS/etc/rc.d/minitel.lua @@ -22,6 +22,7 @@ local dbug = false local modems = {} local port = 4096 local retry = 10 +local retrycount = 64 local route = true --[[ @@ -188,7 +189,7 @@ function start() if v[5] < computer.uptime() then dprint(k,v[1],v[2],hostname,v[3],v[4]) sendPacket(k,v[1],v[2],hostname,v[3],v[4]) - if v[1] ~= 1 or v[6] == 255 then + if v[1] ~= 1 or v[6] == retrycount then pqueue[k] = nil else pqueue[k][5]=computer.uptime()+retry @@ -223,6 +224,10 @@ function set_retry(sn) retry = tonumber(sn) or 30 print("retry = "..tostring(retry)) end +function set_retrycount(sn) + retrycount = tonumber(sn) or 64 + print("retrycount = "..tostring(retrycount)) +end function set_pctime(sn) pctime = tonumber(sn) or 30 print("pctime = "..tostring(pctime))