local cast

This commit is contained in:
云风
2012-10-12 13:45:40 +08:00
parent e8afe6db20
commit 9aeb6f8ed8
6 changed files with 24 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
local c = require "skynet.c"
local mc = require "mcast.c"
local tostring = tostring
local tonumber = tonumber
local coroutine = coroutine
@@ -175,6 +176,11 @@ function skynet.send(addr, typename, ...)
return c.send(addr, p.id, 0 , p.pack(...))
end
function skynet.cast(group, typename, ...)
local p = proto[typename]
return c.send(".cast", p.id, 0, mc(group, p.pack(...)))
end
skynet.genid = assert(c.genid)
skynet.forward = assert(c.forward)