From dab880bc82b2fc0a7f8398811ed2438d6ae62406 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 18 Jun 2021 10:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DWS.update=E4=BC=9A=E5=BE=80tr?= =?UTF-8?q?iggerChannel=E6=97=A0=E6=9D=A1=E4=BB=B6=E4=B8=80=E7=9B=B4push?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E6=97=A0=E6=84=8F=E4=B9=89=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E8=BF=87=E5=A4=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/websocket.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Zframework/websocket.lua b/Zframework/websocket.lua index a4398843..6b634902 100644 --- a/Zframework/websocket.lua +++ b/Zframework/websocket.lua @@ -125,8 +125,9 @@ local lBuffer=""--Long multi-data buffer local UFF--Un-finished-frame mode local sBuffer=""--Short multi-frame buffer while true do--Running - --Send triggerCHN:demand() + + --Send while sendCHN:getCount()>=2 do local op=sendCHN:pop() local message=sendCHN:pop() @@ -341,7 +342,9 @@ function WS.update(dt) local time=timer() for name,ws in next,wsList do if ws.real then - ws.triggerCHN:push(0) + if ws.status~='dead'and ws.triggerCHN:getCount()==0 then + ws.triggerCHN:push(0) + end if ws.status=='connecting'then local mes=ws.readCHN:pop() if mes then