コード例 #1
0
ファイル: PluginI.cs プロジェクト: jlrcnmsn1990/ice
        LocatorI(string name, LookupPrx lookup, Communicator communicator, string instanceName, LocatorPrx voidLocator)
        {
            _lookup  = lookup;
            _timeout = communicator.GetPropertyAsInt($"{name}.Timeout") ?? 300;
            if (_timeout < 0)
            {
                _timeout = 300;
            }
            _retryCount = communicator.GetPropertyAsInt("${name}.RetryCount") ?? 3;
            if (_retryCount < 0)
            {
                _retryCount = 0;
            }
            _retryDelay = communicator.GetPropertyAsInt($"{name}.RetryDelay") ?? 2000;
            if (_retryDelay < 0)
            {
                _retryDelay = 0;
            }
            _timer             = lookup.Communicator.timer();
            _traceLevel        = communicator.GetPropertyAsInt($"{name}.Trace.Lookup") ?? 0;
            _instanceName      = instanceName;
            _warned            = false;
            _locator           = lookup.Communicator.getDefaultLocator();
            _voidLocator       = voidLocator;
            _pending           = false;
            _pendingRetryCount = 0;
            _failureCount      = 0;
            _warnOnce          = true;

            //
            // Create one lookup proxy per endpoint from the given proxy. We want to send a multicast
            // datagram on each endpoint.
            //
            var single = new Endpoint[1];

            foreach (var endpt in lookup.Endpoints)
            {
                single[0] = endpt;
                _lookups[lookup.Clone(endpoints: single)] = null;
            }
            Debug.Assert(_lookups.Count > 0);
        }
コード例 #2
0
        public LookupI(LocatorRegistryI registry, LookupPrx lookup, Ice.Communicator communicator)
        {
            _registry          = registry;
            _lookup            = lookup;
            _timeout           = communicator.GetPropertyAsInt("IceDiscovery.Timeout") ?? 300;
            _retryCount        = communicator.GetPropertyAsInt("IceDiscovery.RetryCount") ?? 3;
            _latencyMultiplier = communicator.GetPropertyAsInt("IceDiscovery.LatencyMultiplier") ?? 1;
            _domainId          = communicator.GetProperty("IceDiscovery.DomainId") ?? "";
            _timer             = lookup.Communicator.timer();

            //
            // Create one lookup proxy per endpoint from the given proxy. We want to send a multicast
            // datagram on each endpoint.
            //
            var single = new Ice.Endpoint[1];

            foreach (var endpt in lookup.Endpoints)
            {
                single[0] = endpt;
                _lookups[lookup.Clone(endpoints: single)] = null;
            }
            Debug.Assert(_lookups.Count > 0);
        }