c/s json protocol example

This commit is contained in:
Cloud Wu
2014-04-14 21:21:47 +08:00
parent 904b68b5a5
commit 98c9059a60
6 changed files with 126 additions and 95 deletions

View File

@@ -1,4 +1,5 @@
local skynet = require "skynet"
local netpack = require "netpack"
local CMD = {}
local SOCKET = {}
@@ -13,7 +14,6 @@ end
local function close_agent(fd)
local a = agent[fd]
if a then
skynet.call(a, "lua", "exit")
skynet.kill(a)
agent[fd] = nil
end
@@ -29,6 +29,9 @@ function SOCKET.error(fd, msg)
close_agent(fd)
end
function SOCKET.data(fd, msg)
end
function CMD.start(conf)
skynet.call(gate, "lua", "open" , conf)
end