Exemplo n.º 1
0
        /// <summary>Initializes a new instance of the <see cref="WCFNetwork"/> class.</summary>
        /// <param name="getConfig">Means of getting configuration for reconnecting with.</param>
        /// <param name="startupPolicy"><see cref="StartupPolicy"/> defining how we startup.</param>
        public WCFNetwork(Func <string> getConfig = null, StartupPolicy startupPolicy = StartupPolicy.Normal)
            : base(startupPolicy)
        {
            var config      = getConfig == null ? null : getConfig();
            var connections = ParseConfiguration(config);

            localAddress = connections?.Item1 == null
                ? new NodeAddress(SchemaName, Environment.MachineName, NetworkManager.FindFreeTcpPort())
                : new NodeAddress(connections.Item1);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NetworkBase"/> class.
 /// </summary>
 /// <param name="startupPolicy">The <see cref="StartupPolicy"/> that this network should have b</param>
 protected NetworkBase(StartupPolicy startupPolicy)
     : this()
 {
     StartupPolicy = startupPolicy;
 }