clustersender tracetag bug

This commit is contained in:
hong
2019-05-06 21:57:10 +08:00
committed by 云风
parent 431feb6f16
commit db61ec376a
2 changed files with 4 additions and 17 deletions

View File

@@ -1,23 +1,14 @@
local skynet = require "skynet"
require "skynet.manager"
local sc = require "skynet.socketchannel"
local socket = require "skynet.socket"
local cluster = require "skynet.cluster.core"
local config_name = skynet.getenv "cluster"
local node_address = {}
local node_session = {}
local node_sender = {}
local command = {}
local config = {}
local nodename = cluster.nodename()
local function read_response(sock)
local sz = socket.header(sock:read(2))
local msg = sock:read(sz)
return cluster.unpackresponse(msg) -- session, ok, data, padding
end
local connecting = {}
local function open_channel(t, key)
@@ -44,7 +35,7 @@ local function open_channel(t, key)
local host, port = string.match(address, "([^:]+):(.*)$")
c = node_sender[key]
if c == nil then
c = skynet.newservice "clustersender"
c = skynet.newservice("clustersender", key, nodename)
if node_sender[key] then
-- double check
skynet.kill(c)