Ejemplo n.º 1
0
            public void Response(LocatorInfo locatorInfo, IObjectPrx?proxy)
            {
                Endpoint[]? endpoints = null;
                if (proxy != null)
                {
                    Reference r = proxy.IceReference;
                    if (_ref.IsWellKnown() && !Protocol.isSupported(_ref.GetEncoding(), r.GetEncoding()))
                    {
                        //
                        // If a well-known proxy and the returned
                        // proxy encoding isn't supported, we're done:
                        // there's no compatible endpoint we can use.
                        //
                    }
                    else if (!r.IsIndirect())
                    {
                        endpoints = r.GetEndpoints();
                    }
                    else if (_ref.IsWellKnown() && !r.IsWellKnown())
                    {
                        //
                        // We're resolving the endpoints of a well-known object and the proxy returned
                        // by the locator is an indirect proxy. We now need to resolve the endpoints
                        // of this indirect proxy.
                        //
                        if (_ref.GetCommunicator().TraceLevels.location >= 1)
                        {
                            locatorInfo.Trace("retrieved adapter for well-known object from locator, " +
                                              "adding to locator cache", _ref, r);
                        }
                        locatorInfo.GetEndpoints(r, _ref, _ttl, _callback);
                        return;
                    }
                }

                if (_ref.GetCommunicator().TraceLevels.location >= 1)
                {
                    locatorInfo.GetEndpointsTrace(_ref, endpoints, false);
                }
                if (_callback != null)
                {
                    _callback.SetEndpoints(endpoints ?? Array.Empty <Endpoint>(), false);
                }
            }
Ejemplo n.º 2
0
            public void Response(LocatorInfo locatorInfo, IObjectPrx?proxy)
            {
                IReadOnlyList <Endpoint>?endpoints = null;

                if (proxy != null)
                {
                    Reference r = proxy.IceReference;
                    if (_ref.IsWellKnown && _ref.Encoding != r.Encoding)
                    {
                        // If a well-known proxy and the returned proxy encoding don't match we're done:
                        // there's no compatible endpoint we can use.
                    }
                    else if (!r.IsIndirect)
                    {
                        endpoints = r.Endpoints;
                    }
                    else if (_ref.IsWellKnown && !r.IsWellKnown)
                    {
                        //
                        // We're resolving the endpoints of a well-known object and the proxy returned
                        // by the locator is an indirect proxy. We now need to resolve the endpoints
                        // of this indirect proxy.
                        //
                        if (_ref.Communicator.TraceLevels.Location >= 1)
                        {
                            locatorInfo.Trace("retrieved adapter for well-known object from locator, " +
                                              "adding to locator cache", _ref, r);
                        }
                        locatorInfo.GetEndpoints(r, _ref, _ttl, _callback);
                        return;
                    }
                }

                if (_ref.Communicator.TraceLevels.Location >= 1)
                {
                    locatorInfo.GetEndpointsTrace(_ref, endpoints, false);
                }
                if (_callback != null)
                {
                    _callback.SetEndpoints(endpoints ?? Array.Empty <Endpoint>(), false);
                }
            }