mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
socket accept can do more than once for transfer
This commit is contained in:
@@ -265,4 +265,14 @@ function socket.unlock(id)
|
||||
until skynet.wakeup(co)
|
||||
end
|
||||
|
||||
-- abandon use to forward socket id to other service
|
||||
-- you must call socket.accept(id) later in other service
|
||||
function socket.abandon(id)
|
||||
local s = socket_pool[id]
|
||||
if s and s.buffer then
|
||||
driver.clear(s.buffer)
|
||||
end
|
||||
socket_pool[id] = nil
|
||||
end
|
||||
|
||||
return socket
|
||||
|
||||
Reference in New Issue
Block a user