mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
report new connection from gate
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local skynet = require "skynet"
|
||||
local client = ...
|
||||
|
||||
skynet.dispatch(function(msg, sz , session, address)
|
||||
local message = skynet.tostring(msg,sz)
|
||||
@@ -6,3 +7,7 @@ skynet.dispatch(function(msg, sz , session, address)
|
||||
local result = skynet.call("SIMPLEDB",message)
|
||||
skynet.send(address, result)
|
||||
end)
|
||||
|
||||
skynet.start(function()
|
||||
skynet.send(client,"Welcome to skynet")
|
||||
end)
|
||||
|
||||
@@ -10,8 +10,8 @@ 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 agent = skynet.launch("snlua","agent")
|
||||
local client = skynet.launch("client",fd)
|
||||
local agent = skynet.launch("snlua","agent",client)
|
||||
print("watchdog launch agent client:",agent,client)
|
||||
if agent then
|
||||
agent_all[self] = { agent , client }
|
||||
|
||||
Reference in New Issue
Block a user