mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
add skynet.blockcall
This commit is contained in:
18
service/pingserver.lua
Normal file
18
service/pingserver.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
local skynet = require "skynet"
|
||||
|
||||
local command = {}
|
||||
|
||||
function command.PING(hello)
|
||||
skynet.ret(skynet.pack(hello))
|
||||
end
|
||||
|
||||
function command.HELLO()
|
||||
skynet.sleep(100)
|
||||
skynet.ret(skynet.pack("hello"))
|
||||
end
|
||||
|
||||
skynet.start(function()
|
||||
skynet.dispatch("lua", function(session,addr, cmd, ...)
|
||||
command[cmd](...)
|
||||
end)
|
||||
end)
|
||||
Reference in New Issue
Block a user