예제 #1
0
파일: PluginI.cs 프로젝트: zhj149/ice
        LocatorI(string name, LookupPrx lookup, Ice.Properties properties, string instanceName,
                 Ice.LocatorPrx voidLocator)
        {
            _lookup            = lookup;
            _timeout           = properties.getPropertyAsIntWithDefault(name + ".Timeout", 300);
            _retryCount        = properties.getPropertyAsIntWithDefault(name + ".RetryCount", 3);
            _retryDelay        = properties.getPropertyAsIntWithDefault(name + ".RetryDelay", 2000);
            _timer             = IceInternal.Util.getInstance(lookup.ice_getCommunicator()).timer();
            _traceLevel        = properties.getPropertyAsInt(name + ".Trace.Lookup");
            _instanceName      = instanceName;
            _warned            = false;
            _locator           = lookup.ice_getCommunicator().getDefaultLocator();
            _voidLocator       = voidLocator;
            _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 Ice.Endpoint[1];

            foreach (var endpt in lookup.ice_getEndpoints())
            {
                single[0] = endpt;
                _lookups[(LookupPrx)lookup.ice_endpoints(single)] = null;
            }
            Debug.Assert(_lookups.Count > 0);
        }
예제 #2
0
파일: PluginI.cs 프로젝트: yiqideren/ice
 LocatorI(LookupPrx lookup, Ice.Properties properties, string instanceName, Ice.LocatorPrx voidLocator)
 {
     _lookup            = lookup;
     _timeout           = properties.getPropertyAsIntWithDefault("IceLocatorDiscovery.Timeout", 300);
     _retryCount        = properties.getPropertyAsIntWithDefault("IceLocatorDiscovery.RetryCount", 3);
     _retryDelay        = properties.getPropertyAsIntWithDefault("IceLocatorDiscovery.RetryDelay", 2000);
     _timer             = IceInternal.Util.getInstance(lookup.ice_getCommunicator()).timer();
     _instanceName      = instanceName;
     _warned            = false;
     _locator           = lookup.ice_getCommunicator().getDefaultLocator();
     _voidLocator       = voidLocator;
     _pendingRetryCount = 0;
 }
예제 #3
0
파일: PluginI.cs 프로젝트: externl/ice
 public LocatorI(LookupPrx lookup, Ice.Properties properties, string instanceName, Ice.LocatorPrx voidLocator)
 {
     _lookup = lookup;
     _timeout = properties.getPropertyAsIntWithDefault("IceLocatorDiscovery.Timeout", 300);
     _retryCount = properties.getPropertyAsIntWithDefault("IceLocatorDiscovery.RetryCount", 3);
     _retryDelay = properties.getPropertyAsIntWithDefault("IceLocatorDiscovery.RetryDelay", 2000);
     _timer = IceInternal.Util.getInstance(lookup.ice_getCommunicator()).timer();
     _instanceName = instanceName;
     _warned = false;
     _locator = lookup.ice_getCommunicator().getDefaultLocator();
     _voidLocator = voidLocator;
     _pendingRetryCount = 0;
 }
예제 #4
0
        LocatorI(string name, LookupPrx lookup, Ice.Properties properties, string instanceName,
                 Ice.LocatorPrx voidLocator)
        {
            _timeout           = properties.getPropertyAsIntWithDefault(name + ".Timeout", 300);
            _retryCount        = properties.getPropertyAsIntWithDefault(name + ".RetryCount", 3);
            _retryDelay        = properties.getPropertyAsIntWithDefault(name + ".RetryDelay", 2000);
            _timer             = IceInternal.Util.getInstance(lookup.ice_getCommunicator()).timer();
            _instanceName      = instanceName;
            _warned            = false;
            _locator           = lookup.ice_getCommunicator().getDefaultLocator();
            _voidLocator       = voidLocator;
            _pendingRetryCount = 0;

            try
            {
                lookup.ice_getConnection();
            }
            catch (Ice.LocalException ex)
            {
                StringBuilder b = new StringBuilder();
                b.Append("IceLocatorDiscovery is unable to establish a multicast connection:\n");
                b.Append("proxy = ");
                b.Append(lookup.ToString());
                b.Append('\n');
                b.Append(ex.ToString());
                throw new Ice.PluginInitializationException(b.ToString());
            }

            //
            // 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.ice_getEndpoints())
            {
                try
                {
                    single[0] = endpt;
                    LookupPrx l = (LookupPrx)lookup.ice_endpoints(single);
                    l.ice_getConnection();
                    _lookup[(LookupPrx)lookup.ice_endpoints(single)] = null;
                }
                catch (Ice.LocalException)
                {
                    // Ignore
                }
            }
            Debug.Assert(_lookup.Count > 0);
        }
예제 #5
0
 public LookupI(LocatorRegistryI registry, LookupPrx lookup, Ice.Properties properties)
 {
     _registry          = registry;
     _lookup            = lookup;
     _timeout           = properties.getPropertyAsIntWithDefault("IceDiscovery.Timeout", 300);
     _retryCount        = properties.getPropertyAsIntWithDefault("IceDiscovery.RetryCount", 3);
     _latencyMultiplier = properties.getPropertyAsIntWithDefault("IceDiscovery.LatencyMultiplier", 1);
     _domainId          = properties.getProperty("IceDiscovery.DomainId");
     _timer             = IceInternal.Util.getInstance(lookup.ice_getCommunicator()).timer();
 }
예제 #6
0
파일: LookupI.cs 프로젝트: zxh1986123/ice
        public LookupI(LocatorRegistryI registry, LookupPrx lookup, Ice.Properties properties)
        {
            _registry          = registry;
            _timeout           = properties.getPropertyAsIntWithDefault("IceDiscovery.Timeout", 300);
            _retryCount        = properties.getPropertyAsIntWithDefault("IceDiscovery.RetryCount", 3);
            _latencyMultiplier = properties.getPropertyAsIntWithDefault("IceDiscovery.LatencyMultiplier", 1);
            _domainId          = properties.getProperty("IceDiscovery.DomainId");
            _timer             = IceInternal.Util.getInstance(lookup.ice_getCommunicator()).timer();

            try
            {
                lookup.ice_getConnection();
            }
            catch (Ice.LocalException ex)
            {
                StringBuilder b = new StringBuilder();
                b.Append("IceDiscovery is unable to establish a multicast connection:\n");
                b.Append("proxy = ");
                b.Append(lookup.ToString());
                b.Append('\n');
                b.Append(ex.ToString());
                throw new Ice.PluginInitializationException(b.ToString());
            }

            //
            // 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.ice_getEndpoints())
            {
                try
                {
                    single[0] = endpt;
                    LookupPrx l = (LookupPrx)lookup.ice_endpoints(single);
                    l.ice_getConnection();
                    _lookup[(LookupPrx)lookup.ice_endpoints(single)] = null;
                }
                catch (Ice.LocalException)
                {
                    // Ignore
                }
            }
            Debug.Assert(_lookup.Count > 0);
        }
예제 #7
0
파일: LookupI.cs 프로젝트: chuanqingli/ice
        public LookupI(LocatorRegistryI registry, LookupPrx lookup, Ice.Properties properties)
        {
            _registry          = registry;
            _lookup            = lookup;
            _timeout           = properties.getPropertyAsIntWithDefault("IceDiscovery.Timeout", 300);
            _retryCount        = properties.getPropertyAsIntWithDefault("IceDiscovery.RetryCount", 3);
            _latencyMultiplier = properties.getPropertyAsIntWithDefault("IceDiscovery.LatencyMultiplier", 1);
            _domainId          = properties.getProperty("IceDiscovery.DomainId");
            _timer             = IceInternal.Util.getInstance(lookup.ice_getCommunicator()).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.ice_getEndpoints())
            {
                single[0] = endpt;
                _lookups[(LookupPrx)lookup.ice_endpoints(single)] = null;
            }
            Debug.Assert(_lookups.Count > 0);
        }