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());
        }
Example #2
0
 public DiscoveredServices(DiscoveredServices <T> container = null) : base(container)
 {
 }
Example #3
0
 public void Dispose()
 {
     AnnouncedSubscribers.Close();
     DiscoveredServices.Close();
 }