コード例 #1
0
        public override bool equivalent(EndpointI endpoint)
        {
            if (!(endpoint is IPEndpointI))
            {
                return(false);
            }
            IPEndpointI ipEndpointI = (IPEndpointI)endpoint;

            return(ipEndpointI.type() == type() && ipEndpointI.host_.Equals(host_) && ipEndpointI.port_ == port_ &&
                   Network.addressEquals(ipEndpointI.sourceAddr_, sourceAddr_));
        }
コード例 #2
0
        public void resolve(string host, int port, Ice.EndpointSelectionType selType, IPEndpointI endpoint,
            EndpointI_connectors 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.
            //
            NetworkProxy networkProxy = _instance.networkProxy();
            if(networkProxy == null)
            {
                try
                {
                    List<EndPoint> addrs = Network.getAddresses(host, port, _protocol, selType, _preferIPv6, false);
                    if(addrs.Count > 0)
                    {
                        callback.connectors(endpoint.connectors(addrs, null));
                        return;
                    }
                }
                catch(Ice.LocalException ex)
                {
                    callback.exception(ex);
                    return;
                }
            }

            lock(this)
            {
                Debug.Assert(!_destroyed);

                ResolveEntry entry = new ResolveEntry();
                entry.host = host;
                entry.port = port;
                entry.selType = selType;
                entry.endpoint = endpoint;
                entry.callback = callback;

                Ice.Instrumentation.CommunicatorObserver obsv = _instance.initializationData().observer;
                if(obsv != null)
                {
                    entry.observer = obsv.getEndpointLookupObserver(endpoint);
                    if(entry.observer != null)
                    {
                        entry.observer.attach();
                    }
                }

                _queue.AddLast(entry);
                System.Threading.Monitor.Pulse(this);
            }
        }
コード例 #3
0
        public override int CompareTo(EndpointI obj)
        {
            if (!(obj is IPEndpointI))
            {
                return(type() < obj.type() ? -1 : 1);
            }

            IPEndpointI p = (IPEndpointI)obj;

            if (this == p)
            {
                return(0);
            }

            int v = string.Compare(host_, p.host_, StringComparison.Ordinal);

            if (v != 0)
            {
                return(v);
            }

            if (port_ < p.port_)
            {
                return(-1);
            }
            else if (p.port_ < port_)
            {
                return(1);
            }

            int rc = string.Compare(Network.endpointAddressToString(sourceAddr_),
                                    Network.endpointAddressToString(p.sourceAddr_), StringComparison.Ordinal);

            if (rc != 0)
            {
                return(rc);
            }

            return(string.Compare(connectionId_, p.connectionId_, StringComparison.Ordinal));
        }
コード例 #4
0
 public void resolve(string host, int port, Ice.EndpointSelectionType type, IPEndpointI endpt,
                     EndpointI_connectors callback)
 {
     instance_.endpointHostResolver().resolve(host, port, type, endpt, callback);
 }
コード例 #5
0
ファイル: TcpEndpointI.cs プロジェクト: zhaochf/ice
 public InfoI(IPEndpointI e)
 {
     _endpoint = e;
 }
コード例 #6
0
ファイル: IPEndpointI.cs プロジェクト: joshmoore/ice
 public InfoI(IPEndpointI e)
 {
     _endpoint = e;
 }
コード例 #7
0
        public void resolve(string host, int port, Ice.EndpointSelectionType selType, IPEndpointI endpoint,
                            EndpointI_connectors 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.
            //
            NetworkProxy networkProxy = _instance.networkProxy();

            if (networkProxy == null)
            {
                try
                {
                    List <EndPoint> addrs = Network.getAddresses(host, port, _protocol, selType, _preferIPv6, false);
                    if (addrs.Count > 0)
                    {
                        callback.connectors(endpoint.connectors(addrs, null));
                        return;
                    }
                }
                catch (Ice.LocalException ex)
                {
                    callback.exception(ex);
                    return;
                }
            }

            lock (this)
            {
                Debug.Assert(!_destroyed);

                ResolveEntry entry = new ResolveEntry();
                entry.host     = host;
                entry.port     = port;
                entry.selType  = selType;
                entry.endpoint = endpoint;
                entry.callback = callback;

                Ice.Instrumentation.CommunicatorObserver obsv = _instance.initializationData().observer;
                if (obsv != null)
                {
                    entry.observer = obsv.getEndpointLookupObserver(endpoint);
                    if (entry.observer != null)
                    {
                        entry.observer.attach();
                    }
                }

                _queue.AddLast(entry);
                Monitor.Pulse(this);
            }
        }
コード例 #8
0
ファイル: WSEndpoint.cs プロジェクト: externl/ice
 internal WSEndpoint(ProtocolInstance instance, EndpointI del, string res)
 {
     _instance = instance;
     _delegate = (IPEndpointI)del;
     _resource = res;
 }
コード例 #9
0
ファイル: WSEndpoint.cs プロジェクト: externl/ice
        internal WSEndpoint(ProtocolInstance instance, EndpointI del, Ice.InputStream s)
        {
            _instance = instance;
            _delegate = (IPEndpointI)del;

            _resource = s.readString();
        }
コード例 #10
0
ファイル: WSEndpoint.cs プロジェクト: externl/ice
        internal WSEndpoint(ProtocolInstance instance, EndpointI del, List<string> args)
        {
            _instance = instance;
            _delegate = (IPEndpointI)del;

            initWithOptions(args);

            if(_resource == null)
            {
                _resource = "/";
            }
        }
コード例 #11
0
ファイル: ProtocolInstance.cs プロジェクト: pedia/zeroc-ice
 public void resolve(string host, int port, Ice.EndpointSelectionType type, IPEndpointI endpt,
                     EndpointI_connectors callback)
 {
     instance_.endpointHostResolver().resolve(host, port, type, endpt, callback);
 }