mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4673344e1e | ||
|
|
b49fc291a7 | ||
|
|
11c528987c |
@@ -34,8 +34,6 @@ Each lua file only load once and cache it in memory during skynet start . so if
|
||||
|
||||
You can also use the offical lua version , edit the makefile by yourself .
|
||||
|
||||
## Blog (in Chinese)
|
||||
## How To (in Chinese)
|
||||
|
||||
* http://blog.codingnow.com/2012/09/the_design_of_skynet.html
|
||||
* http://blog.codingnow.com/2012/08/skynet.html
|
||||
* http://blog.codingnow.com/eo/skynet/
|
||||
* Read Wiki https://github.com/cloudwu/skynet/wiki
|
||||
|
||||
@@ -246,6 +246,7 @@ lclearbuffer(lua_State *L) {
|
||||
while(sb->head) {
|
||||
return_free_node(L,2,sb);
|
||||
}
|
||||
sb->size = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -264,6 +265,7 @@ lreadall(lua_State *L) {
|
||||
return_free_node(L,2,sb);
|
||||
}
|
||||
luaL_pushresult(&b);
|
||||
sb->size = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,8 +50,10 @@ function command.DEL(source, c)
|
||||
channel[c] = nil
|
||||
channel_n[c] = nil
|
||||
channel_remote[c] = nil
|
||||
for node in pairs(remote) do
|
||||
skynet.send(node_address[node], "lua", "DELR", c)
|
||||
if remote then
|
||||
for node in pairs(remote) do
|
||||
skynet.send(node_address[node], "lua", "DELR", c)
|
||||
end
|
||||
end
|
||||
return NORET
|
||||
end
|
||||
|
||||
@@ -4,9 +4,13 @@ local mc = require "multicast"
|
||||
|
||||
skynet.start(function()
|
||||
print("remote start")
|
||||
skynet.monitor("simplemonitor", true)
|
||||
local console = skynet.newservice("console")
|
||||
local channel = dc.get "MCCHANNEL"
|
||||
if channel then
|
||||
print("remote channel", channel)
|
||||
else
|
||||
print("create local channel")
|
||||
end
|
||||
for i=1,10 do
|
||||
local sub = skynet.newservice("testmulticast", "sub")
|
||||
skynet.call(sub, "lua", "init", channel)
|
||||
|
||||
Reference in New Issue
Block a user