Files
skynet/test/pingserver.lua
2014-04-17 15:37:01 +08:00

31 lines
453 B
Lua

local skynet = require "skynet"
local i = 0
local hello = "hello"
function response.ping(hello)
skynet.sleep(100)
return hello
end
function subscribe.hello()
i = i + 1
print (i, hello)
end
function response.error()
error "throw an error"
end
function init( ... )
print ("ping server start:", ...)
-- You can return "queue" for queue service mode
-- return "queue"
end
function exit(...)
print ("ping server exit:", ...)
return "Exit"
end