T[] GetSubscribers() { IEnumerable <string> announcedAddress = AnnouncedSubscribers.FindComplement(Scope).Select((address) => address.Uri.AbsoluteUri); IEnumerable <string> discoveredAddress = DiscoveredServices.FindComplement(Scope).Select((address) => address.Uri.AbsoluteUri); IEnumerable <string> addresses = announcedAddress.Union(discoveredAddress); List <T> subscribers = new List <T>(); foreach (string address in addresses) { EndpointAddress endpointAddress = new EndpointAddress(address); Binding binding = GetBindingFromAddress(endpointAddress); T proxy = ChannelFactory <T> .CreateChannel(binding, endpointAddress); subscribers.Add(proxy); } return(subscribers.ToArray()); }
public void Dispose() { AnnouncedSubscribers.Close(); DiscoveredServices.Close(); }