internal EndpointConnectors(TransportInstance instance, string host, string res, IEndpointConnectors cb) { _instance = instance; _host = host; _resource = res; _callback = cb; }
internal ResolveEntry(string host, int port, EndpointSelectionType selType, IPEndpoint endpoint, IEndpointConnectors callback) { Host = host; Port = port; SelType = selType; Endpoint = endpoint; Callback = callback; }
public void Resolve(string host, int port, EndpointSelectionType selType, IPEndpoint endpoint, IEndpointConnectors callback) { // // Try to get the addresses without DNS lookup. If this doesn't work, we queue a resolve // entry and the thread will take care of getting the endpoint addresses. // INetworkProxy?networkProxy = NetworkProxy; if (networkProxy == null) { try { List <EndPoint> addrs = Network.GetAddresses(host, port, IPVersion, selType, PreferIPv6, false); if (addrs.Count > 0) { callback.Connectors(endpoint.Connectors(addrs, null)); return; } } catch (LocalException ex) { callback.Exception(ex); return; } } lock (_endpointHostResolverThread) { Debug.Assert(!_endpointHostResolverDestroyed); var entry = new ResolveEntry(host, port, selType, endpoint, callback); Instrumentation.ICommunicatorObserver?obsv = Observer; if (obsv != null) { entry.Observer = obsv.GetEndpointLookupObserver(endpoint); if (entry.Observer != null) { entry.Observer.Attach(); } } _enpointHostResolverQueue.AddLast(entry); Monitor.Pulse(_endpointHostResolverThread); } }
public void Resolve(string host, int port, Ice.EndpointSelectionType type, IPEndpoint endpt, IEndpointConnectors callback) => Communicator.Resolve(host, port, type, endpt, callback);
// Returns a connector for this endpoint, or empty list if no connector is available. public abstract void ConnectorsAsync(EndpointSelectionType endpointSelection, IEndpointConnectors callback);
// // Return connectors for this endpoint, or empty list if no connector // is available. // public override void ConnectorsAsync(Ice.EndpointSelectionType endSel, IEndpointConnectors callback) { callback.Connectors(new List <IConnector>()); }
// // Return a connector for this endpoint, or empty list if no connector // is available. // public abstract void ConnectorsAsync(Ice.EndpointSelectionType selType, IEndpointConnectors callback);
public override void ConnectorsAsync(EndpointSelectionType endpointSelection, IEndpointConnectors callback) => Instance.Resolve(Host, Port, endpointSelection, this, callback);
public override void ConnectorsAsync(Ice.EndpointSelectionType endpointSelection, IEndpointConnectors callback) { string host = ""; for (Endpoint?p = _delegate; p != null; p = p.Underlying) { if (p is IPEndpoint ipEndpoint) { host = $"{ipEndpoint.Host}:{ipEndpoint.Port.ToString(CultureInfo.InvariantCulture)}"; break; } } _delegate.ConnectorsAsync(endpointSelection, new EndpointConnectors(_instance, host, Resource, callback)); }