修复WS模块可以在连接成功之前read出数据导致连接流程被打断

This commit is contained in:
MrZ626
2021-06-24 12:54:58 +08:00
parent 22c213b10f
commit 096f162ea6

View File

@@ -325,7 +325,7 @@ end
function WS.read(name)
local ws=wsList[name]
if ws.real and CHN_getCount(ws.readCHN)>=2 then
if ws.real and ws.status~='connecting'and CHN_getCount(ws.readCHN)>=2 then
local op,message=CHN_pop(ws.readCHN),CHN_pop(ws.readCHN)
if op==8 then ws.status='dead'end--8=close
ws.lastPongTime=timer()