diff --git a/lualib/skynet/socket.lua b/lualib/skynet/socket.lua index e85f8d41..8bb2f73c 100644 --- a/lualib/skynet/socket.lua +++ b/lualib/skynet/socket.lua @@ -229,6 +229,15 @@ function socket.start(id, func) return connect(id, func) end +function socket.pause(id) + local s = socket_pool[id] + if s == nil or s.pause then + return + end + driver.pause(id) + s.pause = true +end + function socket.shutdown(id) local s = socket_pool[id] if s then