/// <summary> /// Creates a binding for to use for discovering servers. /// </summary> public static DiscoveryClient Create( ApplicationConfiguration application, ITransportWaitingConnection connection, EndpointConfiguration configuration) { if (configuration == null) { configuration = EndpointConfiguration.Create(); } ITransportChannel channel = DiscoveryChannel.Create(application, connection, configuration, application.CreateMessageContext()); return(new DiscoveryClient(channel)); }
/// <summary> /// Loads a collection of endpoints from a file and overrides the endpoint configuration. /// </summary> public static ConfiguredEndpointCollection Load(ApplicationConfiguration configuration, string filePath, bool overrideConfiguration) { ConfiguredEndpointCollection endpoints = Load(filePath); endpoints.m_defaultConfiguration = EndpointConfiguration.Create(configuration); // override the settings in the configuration. foreach (ConfiguredEndpoint endpoint in endpoints.Endpoints) { if (endpoint.Configuration == null || overrideConfiguration) { endpoint.Update(endpoints.DefaultConfiguration); } } return(endpoints); }
/// <summary> /// Creates a binding for to use for discovering servers. /// </summary> /// <param name="discoveryUrl">The discovery URL.</param> /// <param name="bindingFactory">The binding factory.</param> /// <param name="configuration">The configuration.</param> /// <returns></returns> public static DiscoveryClient Create(Uri discoveryUrl, BindingFactory bindingFactory, EndpointConfiguration configuration) { if (discoveryUrl == null) { throw new ArgumentNullException("discoveryUrl"); } if (bindingFactory == null) { bindingFactory = BindingFactory.Default; } if (configuration == null) { configuration = EndpointConfiguration.Create(); } ITransportChannel channel = DiscoveryChannel.Create(discoveryUrl, bindingFactory, configuration, new ServiceMessageContext()); return(new DiscoveryClient(channel)); }
public static DiscoveryChannel Create(Uri discoveryUrl, string configurationName) { return(Create(discoveryUrl, EndpointConfiguration.Create(), BindingFactory.Default, configurationName)); }