示例#1
0
文件: Timer.cs 项目: yzun/ice
            public override int GetHashCode()
            {
                int h = 5381;

                HashUtil.HashAdd(ref h, Id);
                HashUtil.HashAdd(ref h, ScheduledTime);
                return(h);
            }
示例#2
0
        private void calcHashValue()
        {
            int h = 5381;

            HashUtil.HashAdd(ref h, _type);
            HashUtil.HashAdd(ref h, _rawEncoding);
            HashUtil.HashAdd(ref h, _rawBytes);
            _hashCode = h;
        }
示例#3
0
文件: TcpConnector.cs 项目: yzun/ice
        //
        // Only for use by TcpEndpoint
        //
        internal TcpConnector(ProtocolInstance instance, EndPoint addr, INetworkProxy?proxy, EndPoint?sourceAddr,
                              int timeout, string connectionId)
        {
            _instance     = instance;
            _addr         = addr;
            _proxy        = proxy;
            _sourceAddr   = sourceAddr;
            _timeout      = timeout;
            _connectionId = connectionId;

            _hashCode = 5381;
            HashUtil.HashAdd(ref _hashCode, _addr);
            if (_sourceAddr != null)
            {
                HashUtil.HashAdd(ref _hashCode, _sourceAddr);
            }
            HashUtil.HashAdd(ref _hashCode, _timeout);
            HashUtil.HashAdd(ref _hashCode, _connectionId);
        }
示例#4
0
        //
        // Only for use by UdpEndpointI
        //
        internal UdpConnector(ProtocolInstance instance, EndPoint addr, EndPoint?sourceAddr, string mcastInterface,
                              int mcastTtl, string connectionId)
        {
            _instance       = instance;
            _addr           = addr;
            _sourceAddr     = sourceAddr;
            _mcastInterface = mcastInterface;
            _mcastTtl       = mcastTtl;
            _connectionId   = connectionId;

            _hashCode = 5381;
            HashUtil.HashAdd(ref _hashCode, _addr);
            if (sourceAddr != null)
            {
                HashUtil.HashAdd(ref _hashCode, _sourceAddr);
            }
            HashUtil.HashAdd(ref _hashCode, _mcastInterface);
            HashUtil.HashAdd(ref _hashCode, _mcastTtl);
            HashUtil.HashAdd(ref _hashCode, _connectionId);
        }