Replies: 2 comments 9 replies
-
测试代码:function ServerStart.StartA()
local serverA = "serverA"
local serverB = "serverB"
local clusterMap = {}
clusterMap[serverA] = "192.168.22.68:2100"
clusterMap[serverB] = "192.168.22.68:2200"
cluster.reload(clusterMap)
cluster.open(serverA)
local srvmanagerserviceA = skynet.newservice("srvmanagerserviceA")
skynet.name(".srvmanagerserviceA", srvmanagerserviceA)
cluster.register("srvmanagerserviceA", srvmanagerserviceA)
skynet.sleep(600)
cluster.send(serverB, "@srvmanagerserviceB", "testcode", {
a = 1
})
end
function ServerStart.StartB()
local serverA = "serverA"
local serverB = "serverB"
local clusterMap = {}
clusterMap[serverA] = "192.168.22.68:2100"
clusterMap[serverB] = "192.168.22.68:2200"
cluster.reload(clusterMap)
cluster.open(serverB)
local srvmanagerserviceB = skynet.newservice("srvmanagerserviceB")
skynet.name(".srvmanagerserviceB", srvmanagerserviceB)
cluster.register("srvmanagerserviceB", srvmanagerserviceB)
skynet.sleep(600)
cluster.send(serverA, "@srvmanagerserviceA", "testcode", {
a = 1
})
end ServerStart.StartA() 和ServerStart.StartB() 分别在对应的main中执行 启动配置harbor=0 |
Beta Was this translation helpful? Give feedback.
8 replies
-
学习一下如何用 markdown 贴代码先:https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Beta Was this translation helpful? Give feedback.
All reactions