Exemplo n.º 1
0
        public override bool Equals(object obj)
        {
            if (!(obj is TcpConnector))
            {
                return(false);
            }

            if (this == obj)
            {
                return(true);
            }

            TcpConnector p = (TcpConnector)obj;

            if (_timeout != p._timeout)
            {
                return(false);
            }

            if (!Network.addressEquals(_sourceAddr, p._sourceAddr))
            {
                return(false);
            }

            if (!_connectionId.Equals(p._connectionId))
            {
                return(false);
            }

            return(_addr.Equals(p._addr));
        }
Exemplo n.º 2
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_));
        }
Exemplo n.º 3
0
        public override bool Equals(object obj)
        {
            if (!(obj is UdpConnector))
            {
                return(false);
            }

            if (this == obj)
            {
                return(true);
            }

            UdpConnector p = (UdpConnector)obj;

            if (!_connectionId.Equals(p._connectionId))
            {
                return(false);
            }

            if (!_mcastInterface.Equals(p._mcastInterface))
            {
                return(false);
            }

            if (_mcastTtl != p._mcastTtl)
            {
                return(false);
            }

            if (!Network.addressEquals(_sourceAddr, p._sourceAddr))
            {
                return(false);
            }

            return(_addr.Equals(p._addr));
        }