some bugfix for gate/socket lib

This commit is contained in:
云风
2013-08-24 00:14:01 +08:00
parent 424c84915b
commit 52cf864037
5 changed files with 549 additions and 18 deletions

View File

@@ -17,7 +17,9 @@ local function accepter(id)
end
skynet.start(function()
socket.listen("127.0.0.1", 8000, function(id, addr)
local id = socket.listen("127.0.0.1", 8000)
socket.start(id , function(id, addr)
print("connect from " .. addr .. " " .. id)
-- you can also call skynet.newservice for this socket id
skynet.fork(accepter, id)