mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 03:53:09 +00:00
change source dir
This commit is contained in:
17
service/agent.lua
Normal file
17
service/agent.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
local skynet = require "skynet"
|
||||
local client = ...
|
||||
|
||||
skynet.dispatch(function(msg, sz , session, address)
|
||||
local message = skynet.tostring(msg,sz)
|
||||
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)
|
||||
Reference in New Issue
Block a user