simplify clientsocket lib

This commit is contained in:
Cloud Wu
2014-07-19 14:22:24 +08:00
parent d41c9db019
commit a8b80cd73e
6 changed files with 171 additions and 207 deletions

View File

@@ -16,7 +16,11 @@ end
skynet.start(function()
skynet.dispatch("lua", function(session, address, cmd, ...)
local f = command[string.upper(cmd)]
skynet.ret(skynet.pack(f(...)))
if f then
skynet.ret(skynet.pack(f(...)))
else
error(string.format("Unknown command %s", tostring(cmd)))
end
end)
skynet.register "SIMPLEDB"
end)