简化ws-app的update代码,不再自动重连

This commit is contained in:
MrZ626
2021-04-20 01:03:48 +08:00
parent 5058fdf892
commit 9f04510c9b

View File

@@ -218,11 +218,9 @@ end
--WS tick funcs --WS tick funcs
function NET.updateWS_app() function NET.updateWS_app()
local retryTime=3
while true do while true do
YIELD() YIELD()
local status=WS.status("app") if WS.status("app")=="running"then
if status=="running"then
local message,op=WS.read("app") local message,op=WS.read("app")
if message then if message then
if op=="ping"then if op=="ping"then
@@ -260,11 +258,6 @@ function NET.updateWS_app()
end end
end end
end end
elseif status=="dead"then
retryTime=retryTime-1
if retryTime==0 then return end
for _=1,180 do YIELD()end
WS.connect("app","/app")
end end
end end
end end