diff --git a/lualib/socket.lua b/lualib/socket.lua index 4eaa24d8..12c53f41 100644 --- a/lualib/socket.lua +++ b/lualib/socket.lua @@ -153,6 +153,8 @@ function socket.close(id) end if s.connected then driver.close(s.id) + -- notice: call socket.close in __gc should be carefully, + -- because skynet.wait never return in __gc, so driver.clear may not be called if s.co then -- reading this socket on another coroutine assert(not s.closing)