support multi protocol

This commit is contained in:
云风
2012-08-31 21:18:19 +08:00
parent 1ee802c5c5
commit 0a886cd57c
47 changed files with 542 additions and 520 deletions

View File

@@ -12,9 +12,7 @@ function socket.connect(addr)
if fd == nil then
return true
end
print("connect to " .. addr)
local command = "ADD "..fd.." ".. skynet.address(skynet.self())
skynet.send(".connection", command )
skynet.send(".connection", "text", "ADD", fd , skynet.address(skynet.self()))
object = c.new()
end
@@ -47,7 +45,7 @@ end
function socket.close()
if fd then
c.close(fd)
skynet.send(".connection","DEL "..fd)
skynet.send(".connection","text", "DEL", fd)
fd = nil
end
end