add skynet.blockcall

This commit is contained in:
云风
2012-09-05 14:34:09 +08:00
parent 2126f54d72
commit a00016025e
6 changed files with 115 additions and 18 deletions

18
service/pingserver.lua Normal file
View 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)