-
Notifications
You must be signed in to change notification settings - Fork 0
/
24-test.lua
47 lines (31 loc) · 962 Bytes
/
24-test.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
local skynet = require("skynet")
require "skynet.manager"
local sss = {}
local a = {}
function sss.SET(key,value)
a[key] = value
end
function sss.GET(key)
return a[key]
end
skynet.start(function()
skynet.dispatch("lua",function(s,a,cmd,...)
skynet.error("start dispatch",coroutine.running())
local response = skynet.response()
skynet.fork(function(s,a,cmd,...)
skynet.error("fork",coroutine.running())
cmd = cmd:upper()
local f = sss[cmd]
if f then
-- skynet.retpack(f(...))
a ={ response("st",f(...)) }
for i = 1,#a do
skynet.error("三大发送的法斯蒂芬",a[i])
end
else
skynet.error(string.format("%s:方法不存在",tostring(cmd)))
end
end,s,a,cmd,...)
end)
skynet.register(".test1")
end)