mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +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 .
|
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
|
* Read Wiki https://github.com/cloudwu/skynet/wiki
|
||||||
* http://blog.codingnow.com/2012/08/skynet.html
|
|
||||||
* http://blog.codingnow.com/eo/skynet/
|
|
||||||
|
|||||||
@@ -246,6 +246,7 @@ lclearbuffer(lua_State *L) {
|
|||||||
while(sb->head) {
|
while(sb->head) {
|
||||||
return_free_node(L,2,sb);
|
return_free_node(L,2,sb);
|
||||||
}
|
}
|
||||||
|
sb->size = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -264,6 +265,7 @@ lreadall(lua_State *L) {
|
|||||||
return_free_node(L,2,sb);
|
return_free_node(L,2,sb);
|
||||||
}
|
}
|
||||||
luaL_pushresult(&b);
|
luaL_pushresult(&b);
|
||||||
|
sb->size = 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,10 @@ function command.DEL(source, c)
|
|||||||
channel[c] = nil
|
channel[c] = nil
|
||||||
channel_n[c] = nil
|
channel_n[c] = nil
|
||||||
channel_remote[c] = nil
|
channel_remote[c] = nil
|
||||||
for node in pairs(remote) do
|
if remote then
|
||||||
skynet.send(node_address[node], "lua", "DELR", c)
|
for node in pairs(remote) do
|
||||||
|
skynet.send(node_address[node], "lua", "DELR", c)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return NORET
|
return NORET
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,9 +4,13 @@ local mc = require "multicast"
|
|||||||
|
|
||||||
skynet.start(function()
|
skynet.start(function()
|
||||||
print("remote start")
|
print("remote start")
|
||||||
skynet.monitor("simplemonitor", true)
|
|
||||||
local console = skynet.newservice("console")
|
local console = skynet.newservice("console")
|
||||||
local channel = dc.get "MCCHANNEL"
|
local channel = dc.get "MCCHANNEL"
|
||||||
|
if channel then
|
||||||
|
print("remote channel", channel)
|
||||||
|
else
|
||||||
|
print("create local channel")
|
||||||
|
end
|
||||||
for i=1,10 do
|
for i=1,10 do
|
||||||
local sub = skynet.newservice("testmulticast", "sub")
|
local sub = skynet.newservice("testmulticast", "sub")
|
||||||
skynet.call(sub, "lua", "init", channel)
|
skynet.call(sub, "lua", "init", channel)
|
||||||
|
|||||||
Reference in New Issue
Block a user