public void RemoveSubAddress(string addr) { if (string.IsNullOrEmpty(addr)) { return; } addr = addr.Trim().ToLower(); if (ConnectingAddrs.Contains(addr)) { Socket.Disconnect(addr); ConnectingAddrs.Remove(addr); } }
public void AddExtraAddress(string addr) { if (string.IsNullOrEmpty(addr)) { return; } addr = addr.Trim().ToLower(); if (ConnectingAddrs.Contains(addr)) { return; } ZError error; if (!Socket.Connect(addr, out error)) { Trace.WriteLine("添加额外的订阅地址失败:" + error.Text); } else { ConnectingAddrs.Add(addr); } }