fix api for filter

This commit is contained in:
云风
2012-08-10 10:52:17 +08:00
parent f57e98205d
commit c35e1152fe
2 changed files with 13 additions and 10 deletions

View File

@@ -1,12 +1,6 @@
local skynet = require "skynet"
local client = ...
local dispatch_handler = skynet.default_dispatch(function (msg,sz)
local message = skynet.tostring(msg,sz)
local result = skynet.call("SIMPLEDB",message)
skynet.ret(result)
end)
local session_id = 0
skynet.filter(function (session, address , msg, sz)
if address == client then
@@ -18,7 +12,11 @@ skynet.filter(function (session, address , msg, sz)
else
print("skynet message",msg,sz)
end
dispatch_handler(session,address, msg,sz)
return session, address , msg, sz
end, function (msg,sz)
local message = skynet.tostring(msg,sz)
local result = skynet.call("SIMPLEDB",message)
skynet.ret(result)
end)
skynet.start(function()