mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
17 lines
334 B
Lua
17 lines
334 B
Lua
local skynet = require "skynet"
|
|
local client = ...
|
|
|
|
skynet.dispatch(function(msg,session)
|
|
if session == 0 then
|
|
print("client command",msg)
|
|
local result = skynet.call("SIMPLEDB",msg)
|
|
skynet.send(client, result)
|
|
else
|
|
print("server command",msg)
|
|
if msg == "CLOSE" then
|
|
skynet.kill(client)
|
|
skynet.exit()
|
|
end
|
|
end
|
|
end)
|