From 16f337531ac216523419dee9cf61047fb9b0ccc3 Mon Sep 17 00:00:00 2001 From: Izaya Date: Thu, 5 Apr 2018 20:48:57 +1000 Subject: [PATCH] changed the timeout for the bridge server and made the output more useful --- TCPBridge/bridge.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TCPBridge/bridge.lua b/TCPBridge/bridge.lua index 008381c..4af1ecf 100644 --- a/TCPBridge/bridge.lua +++ b/TCPBridge/bridge.lua @@ -66,7 +66,7 @@ function clientLoop() client.conn:close() clients[id] = nil end - if client.last+30 < os.time() then + if client.last+3000 < os.time() then print("Dropping client "..tostring(id).." for inactivity") client.conn:close() clients[id] = nil @@ -81,11 +81,11 @@ spawn(clientLoop) function pushLoop() while true do for id,msg in pairs(messages) do - for _,client in pairs(clients) do + for k,client in pairs(clients) do client.conn:send(msg) + reprint("Message #"..tostring(id).." -> Client #"..tostring(k).." - "..msg) end messages[id] = nil - reprint(msg) end coroutine.yield() end