修复WS.update会往triggerChannel无条件一直push导致无意义消息数量过多
This commit is contained in:
@@ -125,8 +125,9 @@ local lBuffer=""--Long multi-data buffer
|
|||||||
local UFF--Un-finished-frame mode
|
local UFF--Un-finished-frame mode
|
||||||
local sBuffer=""--Short multi-frame buffer
|
local sBuffer=""--Short multi-frame buffer
|
||||||
while true do--Running
|
while true do--Running
|
||||||
--Send
|
|
||||||
triggerCHN:demand()
|
triggerCHN:demand()
|
||||||
|
|
||||||
|
--Send
|
||||||
while sendCHN:getCount()>=2 do
|
while sendCHN:getCount()>=2 do
|
||||||
local op=sendCHN:pop()
|
local op=sendCHN:pop()
|
||||||
local message=sendCHN:pop()
|
local message=sendCHN:pop()
|
||||||
@@ -341,7 +342,9 @@ function WS.update(dt)
|
|||||||
local time=timer()
|
local time=timer()
|
||||||
for name,ws in next,wsList do
|
for name,ws in next,wsList do
|
||||||
if ws.real then
|
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
|
if ws.status=='connecting'then
|
||||||
local mes=ws.readCHN:pop()
|
local mes=ws.readCHN:pop()
|
||||||
if mes then
|
if mes then
|
||||||
|
|||||||
Reference in New Issue
Block a user