mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
support multi protocol
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user