Пример #1
0
 /// <summary>
 /// Used if we're connecting with gossip seeds
 /// </summary>
 /// <param name="gossipSeeds">Endpoints for seeding gossip</param>
 /// <param name="maxDiscoverAttempts">Maximum number of attempts to discover the cluster</param>
 /// <param name="gossipTimeout">Timeout for cluster gossip</param>
 internal ClusterSettings(GossipSeed[] gossipSeeds, int maxDiscoverAttempts, TimeSpan gossipTimeout)
 {
     ClusterDns = "";
     MaxDiscoverAttempts = maxDiscoverAttempts;
     ExternalGossipPort = 0;
     GossipTimeout = gossipTimeout;
     GossipSeeds = gossipSeeds;
 }
Пример #2
0
        internal ConnectionSettings(ILogger log,
                                    bool verboseLogging,
                                    int maxQueueSize,
                                    int maxConcurrentItems,
                                    int maxRetries,
                                    int maxReconnections,
                                    bool requireMaster,
                                    TimeSpan reconnectionDelay,
                                    TimeSpan operationTimeout,
                                    TimeSpan operationTimeoutCheckPeriod,
                                    UserCredentials defaultUserCredentials,
                                    bool useSslConnection,
                                    string targetHost,
                                    bool validateServer,
                                    bool failOnNoServerResponse,
                                    TimeSpan heartbeatInterval,
                                    TimeSpan heartbeatTimeout,
                                    TimeSpan clientConnectionTimeout,
                                    string clusterDns,
                                    GossipSeed[] gossipSeeds,
                                    int maxDiscoverAttempts, 
                                    int externalGossipPort, 
                                    TimeSpan gossipTimeout)
        {
            Ensure.NotNull(log, "log");
            Ensure.Positive(maxQueueSize, "maxQueueSize");
            Ensure.Positive(maxConcurrentItems, "maxConcurrentItems");
            if (maxRetries < -1)
                throw new ArgumentOutOfRangeException("maxRetries", string.Format("maxRetries value is out of range: {0}. Allowed range: [-1, infinity].", maxRetries));
            if (maxReconnections < -1)
                throw new ArgumentOutOfRangeException("maxReconnections", string.Format("maxReconnections value is out of range: {0}. Allowed range: [-1, infinity].", maxRetries));
            if (useSslConnection)
                Ensure.NotNullOrEmpty(targetHost, "targetHost");
            Log = log;
            VerboseLogging = verboseLogging;
            MaxQueueSize = maxQueueSize;
            MaxConcurrentItems = maxConcurrentItems;
            MaxRetries = maxRetries;
            MaxReconnections = maxReconnections;
            RequireMaster = requireMaster;
            ReconnectionDelay = reconnectionDelay;
            OperationTimeout = operationTimeout;
            OperationTimeoutCheckPeriod = operationTimeoutCheckPeriod;
            ClientConnectionTimeout = clientConnectionTimeout;
            DefaultUserCredentials = defaultUserCredentials;
            UseSslConnection = useSslConnection;
            TargetHost = targetHost;
            ValidateServer = validateServer;

            FailOnNoServerResponse = failOnNoServerResponse;
            HeartbeatInterval = heartbeatInterval;
            HeartbeatTimeout = heartbeatTimeout;
            ClusterDns = clusterDns;
            GossipSeeds = gossipSeeds;
            MaxDiscoverAttempts = maxDiscoverAttempts;
            ExternalGossipPort = externalGossipPort;
            GossipTimeout = gossipTimeout;
        }