コード例 #1
0
ファイル: Lookup.cs プロジェクト: tchernobog/ice
        public void SetLookupReply(ILookupReplyPrx lookupReply)
        {
            //
            // Use a lookup reply proxy whose adress matches the interface used to send multicast datagrams.
            //
            var single = new Ice.IEndpoint[1];

            foreach (ILookupPrx key in new List <ILookupPrx>(_lookups.Keys))
            {
                var info = (Ice.UDPEndpointInfo)key.Endpoints[0].GetInfo();
                if (info.McastInterface.Length > 0)
                {
                    foreach (IEndpoint q in lookupReply.Endpoints)
                    {
                        EndpointInfo r = q.GetInfo();
                        if (r is Ice.IPEndpointInfo && ((Ice.IPEndpointInfo)r).Host.Equals(info.McastInterface))
                        {
                            single[0]     = q;
                            _lookups[key] = lookupReply.Clone(endpoints: single);
                        }
                    }
                }

                if (_lookups[key] == null)
                {
                    // Fallback: just use the given lookup reply proxy if no matching endpoint found.
                    _lookups[key] = lookupReply;
                }
            }
        }
コード例 #2
0
ファイル: InstrumentationI.cs プロジェクト: tchernobog/ice
 public RemoteInvocationHelper(Ice.ConnectionInfo con, Ice.IEndpoint endpt, int requestId, int size) :
     base(_attributes)
 {
     _connectionInfo = con;
     _endpoint       = endpt;
     _requestId      = requestId;
     _size           = size;
 }
コード例 #3
0
 public void AttachRemoteObserver(Ice.ConnectionInfo info, Ice.IEndpoint endpt, int requestId)
 {
     Ice.Instrumentation.IInvocationObserver?observer = GetObserver();
     if (observer != null)
     {
         Debug.Assert(RequestFrame != null);
         ChildObserver = observer.GetRemoteObserver(info, endpt, requestId, RequestFrame.Size);
         if (ChildObserver != null)
         {
             ChildObserver.Attach();
         }
     }
 }
コード例 #4
0
 public void AttachRemoteObserver(Ice.ConnectionInfo info, Ice.IEndpoint endpt, int requestId)
 {
     Ice.Instrumentation.IInvocationObserver?observer = GetObserver();
     if (observer != null)
     {
         int size = Os !.Size - Protocol.headerSize - 4;
         ChildObserver = observer.GetRemoteObserver(info, endpt, requestId, size);
         if (ChildObserver != null)
         {
             ChildObserver.Attach();
         }
     }
 }
コード例 #5
0
ファイル: Lookup.cs プロジェクト: tchernobog/ice
        public Lookup(LocatorRegistry registry, ILookupPrx lookup, 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.IEndpoint[1];

            foreach (IEndpoint endpt in lookup.Endpoints)
            {
                single[0] = endpt;
                _lookups[lookup.Clone(endpoints: single)] = null;
            }
            Debug.Assert(_lookups.Count > 0);
        }
コード例 #6
0
ファイル: InstrumentationI.cs プロジェクト: tchernobog/ice
 public Ice.Instrumentation.IRemoteObserver GetRemoteObserver(Ice.ConnectionInfo con, Ice.IEndpoint endpt,
                                                              int requestId, int size)
 {
     Ice.Instrumentation.IRemoteObserver del = null;
     if (Delegate != null)
     {
         del = Delegate.GetRemoteObserver(con, endpt, requestId, size);
     }
     return(GetObserver <RemoteMetrics, RemoteObserverI,
                         Ice.Instrumentation.IRemoteObserver>("Remote",
                                                              new RemoteInvocationHelper(con, endpt, requestId, size),
                                                              del));
 }