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