fix socketchannel closed thread not wakeup (#2020)

This commit is contained in:
华仔
2024-12-30 21:26:40 +08:00
committed by GitHub
parent 7c3942cdbd
commit 474f04e864

View File

@@ -116,6 +116,11 @@ local function dispatch_by_session(self)
end end
skynet.wakeup(co) skynet.wakeup(co)
end end
if not self.__sock then
-- closed
wakeup_all(self, "channel_closed")
break
end
else else
self.__thread[session] = nil self.__thread[session] = nil
skynet.error("socket: unknown session :", session) skynet.error("socket: unknown session :", session)
@@ -211,6 +216,11 @@ local function dispatch_by_order(self)
self.__result_data[co] = result_data self.__result_data[co] = result_data
end end
skynet.wakeup(co) skynet.wakeup(co)
if not self.__sock then
-- closed
wakeup_all(self, "channel_closed")
break
end
else else
close_channel_socket(self) close_channel_socket(self)
local errmsg local errmsg