Commit 188558e8527123cdd1dfdb08a7a0aaea603b1fbe
1 parent
be9c9ca6
skynet 1.2.0 use session for other uses call skynet.ignoreret
Showing
1 changed file
with
6 additions
and
0 deletions
Show diff stats
src/agent.lua
@@ -148,6 +148,8 @@ skynet.register_protocol { | @@ -148,6 +148,8 @@ skynet.register_protocol { | ||
148 | return cmd, string.sub(data, 3) | 148 | return cmd, string.sub(data, 3) |
149 | end, | 149 | end, |
150 | dispatch = function(session, address, cmd, data) | 150 | dispatch = function(session, address, cmd, data) |
151 | + skynet.ignoreret() | ||
152 | + skynet.trace() --执行序的跟踪统计 | ||
151 | cs(function() | 153 | cs(function() |
152 | if cmd == actionCodes.Sys_heartBeat then | 154 | if cmd == actionCodes.Sys_heartBeat then |
153 | agent_util:heart_beat(agentInfo) | 155 | agent_util:heart_beat(agentInfo) |
@@ -188,6 +190,7 @@ skynet.register_protocol { | @@ -188,6 +190,7 @@ skynet.register_protocol { | ||
188 | pack = skynet.pack, | 190 | pack = skynet.pack, |
189 | unpack = skynet.unpack, | 191 | unpack = skynet.unpack, |
190 | dispatch = function(session, address, submethod, ...) | 192 | dispatch = function(session, address, submethod, ...) |
193 | + skynet.trace() --执行序的跟踪统计 | ||
191 | local result | 194 | local result |
192 | if not agentInfo.role then | 195 | if not agentInfo.role then |
193 | result = "__OFFLINE__" | 196 | result = "__OFFLINE__" |
@@ -253,11 +256,14 @@ end | @@ -253,11 +256,14 @@ end | ||
253 | 256 | ||
254 | skynet.start(function() | 257 | skynet.start(function() |
255 | skynet.dispatch("lua", function(session, source, command, ...) | 258 | skynet.dispatch("lua", function(session, source, command, ...) |
259 | + skynet.trace() --执行序的跟踪统计 | ||
256 | local f = CMD[command] | 260 | local f = CMD[command] |
257 | if f then | 261 | if f then |
258 | if command == "exit" then | 262 | if command == "exit" then |
263 | + skynet.ignoreret() | ||
259 | f(...) | 264 | f(...) |
260 | elseif command == "start" then | 265 | elseif command == "start" then |
266 | + skynet.ignoreret() | ||
261 | f(session, source, ...) | 267 | f(session, source, ...) |
262 | else | 268 | else |
263 | skynet.ret(skynet.pack(f(...))) | 269 | skynet.ret(skynet.pack(f(...))) |