Commit a18c543c authored by 潘栩锋's avatar 潘栩锋 🚴

ObjServiceClientManager 创建objClient时,没有地址,创建连接到0.0.0.1:12345, 不可能存在的地址。避免通讯出错

parent 60be6282
......@@ -33,12 +33,14 @@ namespace FObjBase
return instance;
}
}
/// <summary>
/// 连接地址
/// </summary>
[JsonProperty]
public List<ConnAddr> ConnAddrs = new List<ConnAddr>();
public List<ConnAddr> ConnAddrs { get; } = new List<ConnAddr>();
/// <summary>
/// 连接到 另一个Obj系统
/// </summary>
......@@ -52,7 +54,9 @@ namespace FObjBase
if (connaddr == null)
{
//没有,那就创建一个
connaddr = new ConnAddr() { ConnName = connName, Addr = "127.0.0.1:20006" };
//创建连接到不存在的地址,避免出错
connaddr = new ConnAddr() { ConnName = connName, Addr = "0.0.0.1:12345" };
ConnAddrs.Add(connaddr);
}
foreach (var id in fObjClient.GetIDs())
......@@ -121,8 +125,7 @@ namespace FObjBase
{
string json = File.ReadAllText(filename);
JsonConvert.PopulateObject(json, this);
if (this.ConnAddrs == null)
this.ConnAddrs = new List<ConnAddr>();
}
catch
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment