mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-22 02:53:09 +00:00
After connecting, socket can send before connected. remove block connect api
This commit is contained in:
@@ -3,8 +3,10 @@ mqueue = 256
|
||||
cpath = "./cservice/?.so"
|
||||
logger = nil
|
||||
harbor = 2
|
||||
address = "127.0.0.1:2527"
|
||||
master = "127.0.0.1:2013"
|
||||
--address = "127.0.0.1:2527"
|
||||
--master = "127.0.0.1:2013"
|
||||
address = "172.16.100.201:2527"
|
||||
master = "172.16.100.209:2013"
|
||||
start = "main_log"
|
||||
luaservice ="./service/?.lua;./test/?.lua;./examples/?.lua"
|
||||
snax = "./examples/?.lua;./test/?.lua"
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
local skynet = require "skynet"
|
||||
|
||||
skynet.register_protocol {
|
||||
name = "text",
|
||||
id = skynet.PTYPE_TEXT,
|
||||
pack = function (...)
|
||||
local n = select ("#" , ...)
|
||||
if n == 0 then
|
||||
return ""
|
||||
elseif n == 1 then
|
||||
return tostring(...)
|
||||
else
|
||||
return table.concat({...}," ")
|
||||
end
|
||||
end,
|
||||
unpack = skynet.tostring
|
||||
}
|
||||
|
||||
skynet.start(function()
|
||||
skynet.dispatch("text", function(session, address, text)
|
||||
print("[GLOBALLOG]", skynet.address(address),text)
|
||||
|
||||
@@ -2,7 +2,6 @@ local skynet = require "skynet"
|
||||
|
||||
skynet.start(function()
|
||||
print("Log server start")
|
||||
local service = skynet.newservice("service_mgr")
|
||||
skynet.monitor "simplemonitor"
|
||||
local log = skynet.newservice("globallog")
|
||||
skynet.exit()
|
||||
|
||||
Reference in New Issue
Block a user