multicast.bind channel

This commit is contained in:
Cloud Wu
2014-04-28 20:50:00 +08:00
parent 0a40d9c5c6
commit be948c6675
2 changed files with 8 additions and 1 deletions

View File

@@ -20,6 +20,12 @@ function multicast.newchannel(conf)
return channel
end
function multicast.bind(channel, conf)
assert(multicastd, "Init first")
assert(not dispatch[channel])
dispatch[channel] = default_conf(conf)
end
function multicast.publish(channel, ...)
local conf = assert(dispatch[channel])
skynet.call(multicastd, "lua", "PUB", channel, c.pack(conf.pack(...)))