gate support write, and service client forward message to gate

This commit is contained in:
云风
2013-05-25 22:37:58 +08:00
parent 0f4e34a006
commit 1094569c51
6 changed files with 275 additions and 128 deletions

View File

@@ -9,7 +9,7 @@ function command:open(parm)
local fd,addr = string.match(parm,"(%d+) ([^%s]+)")
fd = tonumber(fd)
print("agent open",self,string.format("%d %d %s",self,fd,addr))
local client = skynet.launch("client",fd)
local client = skynet.launch("client",fd, gate, self)
local agent = skynet.launch("snlua","agent",skynet.address(client))
if agent then
agent_all[self] = { agent , client }