public override int GetHashCode() { lock (this) { if (!_hashInitialized) { _hashValue = 5381; HashUtil.hashAdd(ref _hashValue, type()); hashInit(ref _hashValue); _hashInitialized = true; } return(_hashValue); } }
// // Only for use by TcpEndpoint // internal TcpConnector(ProtocolInstance instance, EndPoint addr, NetworkProxy 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); }
// // 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); }
public override void hashInit(ref int h) { base.hashInit(ref h); HashUtil.hashAdd(ref h, _timeout); HashUtil.hashAdd(ref h, _compress); }