本文整理汇总了C#中EndpointI.type方法的典型用法代码示例。如果您正苦于以下问题:C# EndpointI.type方法的具体用法?C# EndpointI.type怎么用?C# EndpointI.type使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EndpointI
的用法示例。
在下文中一共展示了EndpointI.type方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompareTo
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);
}
示例2: CompareTo
//
// Compare endpoints for sorting purposes
//
public override int CompareTo(EndpointI obj)
{
if(!(obj is OpaqueEndpointI))
{
return type() < obj.type() ? -1 : 1;
}
OpaqueEndpointI p = (OpaqueEndpointI)obj;
if(this == p)
{
return 0;
}
if(_type < p._type)
{
return -1;
}
else if(p._type < _type)
{
return 1;
}
if(_rawEncoding.major < p._rawEncoding.major)
{
return -1;
}
else if(p._rawEncoding.major < _rawEncoding.major)
{
return 1;
}
if(_rawEncoding.minor < p._rawEncoding.minor)
{
return -1;
}
else if(p._rawEncoding.minor < _rawEncoding.minor)
{
return 1;
}
if(_rawBytes.Length < p._rawBytes.Length)
{
return -1;
}
else if(p._rawBytes.Length < _rawBytes.Length)
{
return 1;
}
for(int i = 0; i < _rawBytes.Length; i++)
{
if(_rawBytes[i] < p._rawBytes[i])
{
return -1;
}
else if(p._rawBytes[i] < _rawBytes[i])
{
return 1;
}
}
return 0;
}
示例3: CompareTo
//
// Compare endpoints for sorting purposes
//
public override int CompareTo(EndpointI obj)
{
if(!(obj is TcpEndpointI))
{
return type() < obj.type() ? -1 : 1;
}
TcpEndpointI p = (TcpEndpointI)obj;
if(this == p)
{
return 0;
}
else
{
int r = base.CompareTo(p);
if(r != 0)
{
return r;
}
}
if(_port < p._port)
{
return -1;
}
else if(p._port < _port)
{
return 1;
}
if(_timeout < p._timeout)
{
return -1;
}
else if(p._timeout < _timeout)
{
return 1;
}
if(!_compress && p._compress)
{
return -1;
}
else if(!p._compress && _compress)
{
return 1;
}
return string.Compare(_host, p._host, StringComparison.Ordinal);
}
示例4: CompareTo
public override int CompareTo(EndpointI obj)
{
if(!(obj is TcpEndpointI))
{
return type() < obj.type() ? -1 : 1;
}
TcpEndpointI p = (TcpEndpointI)obj;
if(this == p)
{
return 0;
}
if(_timeout < p._timeout)
{
return -1;
}
else if(p._timeout < _timeout)
{
return 1;
}
if(!_compress && p._compress)
{
return -1;
}
else if(!p._compress && _compress)
{
return 1;
}
return base.CompareTo(p);
}
示例5: CompareTo
public override int CompareTo(EndpointI obj)
{
if(!(obj is EndpointI))
{
return type() < obj.type() ? -1 : 1;
}
WSEndpoint p = (WSEndpoint)obj;
if(this == p)
{
return 0;
}
int v = string.Compare(_resource, p._resource, StringComparison.Ordinal);
if(v != 0)
{
return v;
}
return _delegate.CompareTo(p._delegate);
}
示例6: CompareTo
//
// Compare endpoints for sorting purposes
//
public override int CompareTo(EndpointI obj)
{
if(!(obj is UdpEndpointI))
{
return type() < obj.type() ? -1 : 1;
}
UdpEndpointI p = (UdpEndpointI)obj;
if(this == p)
{
return 0;
}
if(!_connect && p._connect)
{
return -1;
}
else if(!p._connect && _connect)
{
return 1;
}
if(!_compress && p._compress)
{
return -1;
}
else if(!p._compress && _compress)
{
return 1;
}
int rc = string.Compare(_mcastInterface, p._mcastInterface, StringComparison.Ordinal);
if(rc != 0)
{
return rc;
}
if(_mcastTtl < p._mcastTtl)
{
return -1;
}
else if(p._mcastTtl < _mcastTtl)
{
return 1;
}
return base.CompareTo(p);
}
示例7: CompareTo
//
// Compare endpoints for sorting purposes
//
public override int CompareTo(EndpointI obj)
{
if(!(obj is UdpEndpointI))
{
return type() < obj.type() ? -1 : 1;
}
UdpEndpointI p = (UdpEndpointI)obj;
if(this == p)
{
return 0;
}
else
{
int r = base.CompareTo(p);
if(r != 0)
{
return r;
}
}
if(_port < p._port)
{
return -1;
}
else if(p._port < _port)
{
return 1;
}
if(!_connect && p._connect)
{
return -1;
}
else if(!p._connect && _connect)
{
return 1;
}
if(!connectionId_.Equals(p.connectionId_))
{
return string.Compare(connectionId_, p.connectionId_, StringComparison.Ordinal);
}
if(!_compress && p._compress)
{
return -1;
}
else if(!p._compress && _compress)
{
return 1;
}
int rc = string.Compare(_mcastInterface, p._mcastInterface, StringComparison.Ordinal);
if(rc != 0)
{
return rc;
}
if(_mcastTtl < p._mcastTtl)
{
return -1;
}
else if(p._mcastTtl < _mcastTtl)
{
return 1;
}
return string.Compare(_host, p._host, StringComparison.Ordinal);
}