socket accept can do more than once for transfer

This commit is contained in:
云风
2013-08-22 18:58:52 +08:00
parent 4d8390ba66
commit 35b0f28fcc
2 changed files with 16 additions and 4 deletions

View File

@@ -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