From 6dfdebc1a2c2c4eb6d38a375eb9957dce2fbfe20 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Thu, 15 Oct 2020 20:25:29 +0800 Subject: [PATCH] reset pause after wait --- lualib/skynet/socket.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lualib/skynet/socket.lua b/lualib/skynet/socket.lua index 7eadeb1a..3f99e9ef 100644 --- a/lualib/skynet/socket.lua +++ b/lualib/skynet/socket.lua @@ -46,9 +46,11 @@ local function suspend(s) skynet.yield() -- there are subsequent socket messages in mqueue, maybe. skynet.error(string.format("Resume socket (%d)", s.id)) driver.start(s.id) + skynet.wait(s.co) s.pause = nil + else + skynet.wait(s.co) end - skynet.wait(s.co) -- wakeup closing corouting every time suspend, -- because socket.close() will wait last socket buffer operation before clear the buffer. if s.closing then