mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
c/s json protocol example
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user