本文整理汇总了C#中EndpointI类的典型用法代码示例。如果您正苦于以下问题:C# EndpointI类的具体用法?C# EndpointI怎么用?C# EndpointI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EndpointI类属于命名空间,在下文中一共展示了EndpointI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WSEndpoint
internal WSEndpoint(ProtocolInstance instance, EndpointI del, BasicStream s)
{
_instance = instance;
_delegate = (IPEndpointI)del;
_resource = s.readString();
}
示例2: create
public Reference create(Ice.Identity ident, string facet, Reference tmpl, EndpointI[] endpoints)
{
if(ident.name.Length == 0 && ident.category.Length == 0)
{
return null;
}
return create(ident, facet, tmpl.getMode(), tmpl.getSecure(), endpoints, null, null);
}
示例3: resolve
public List<Connector> resolve(string host, int port, Ice.EndpointSelectionType selType, EndpointI endpoint)
{
//
// Try to get the addresses without DNS lookup. If this doesn't
// work, we retry with DNS lookup (and observer).
//
NetworkProxy networkProxy = _instance.networkProxy();
if(networkProxy == null)
{
List<EndPoint> addrs = Network.getAddresses(host, port, _protocol, selType, _preferIPv6, false);
if(addrs.Count > 0)
{
return endpoint.connectors(addrs, null);
}
}
Ice.Instrumentation.CommunicatorObserver obsv = _instance.getObserver();
Ice.Instrumentation.Observer observer = null;
if(obsv != null)
{
observer = obsv.getEndpointLookupObserver(endpoint);
if(observer != null)
{
observer.attach();
}
}
List<Connector> connectors = null;
try
{
if(networkProxy != null)
{
networkProxy = networkProxy.resolveHost();
}
connectors = endpoint.connectors(Network.getAddresses(host, port, _protocol, selType, _preferIPv6,
true),
networkProxy);
}
catch(Ice.LocalException ex)
{
if(observer != null)
{
observer.failed(ex.ice_name());
}
throw ex;
}
finally
{
if(observer != null)
{
observer.detach();
}
}
return connectors;
}
示例4: destroy
public void destroy()
{
lock(this)
{
_clientEndpoints = new EndpointI[0];
_serverEndpoints = new EndpointI[0];
_adapter = null;
_identities.Clear();
}
}
示例5: read
public IceInternal.EndpointI read(Ice.InputStream s)
{
short type = s.readShort();
Debug.Assert(type == _factory.type());
s.startEncapsulation();
IceInternal.EndpointI endpoint = new EndpointI(_factory.read(s));
s.endEncapsulation();
return endpoint;
}
示例6: read
public IceInternal.EndpointI read(IceInternal.BasicStream s)
{
short type = s.readShort();
Debug.Assert(type == _factory.type());
s.startReadEncaps();
IceInternal.EndpointI endpoint = new EndpointI(_factory.read(s));
s.endReadEncaps();
return endpoint;
}
示例7: 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);
}
示例8: equivalent
//
// Check whether the endpoint is equivalent to another one.
//
public override bool equivalent(EndpointI endpoint)
{
if(!(endpoint is TcpEndpointI))
{
return false;
}
TcpEndpointI tcpEndpointI = (TcpEndpointI)endpoint;
return tcpEndpointI._host.Equals(_host) && tcpEndpointI._port == _port;
}
示例9: acceptor
//
// Return an acceptor for this endpoint, or null if no acceptors
// is available. In case an acceptor is created, this operation
// also returns a new "effective" endpoint, which might differ
// from this endpoint, for example, if a dynamic port number is
// assigned.
//
public override Acceptor acceptor(ref EndpointI endpoint, string adapterName)
{
#if SILVERLIGHT
throw new Ice.FeatureNotSupportedException("server endpoint not supported for `" + ToString() + "'");
#else
TcpAcceptor p = new TcpAcceptor(_instance, _host, _port);
endpoint = new TcpEndpointI(_instance, _host, p.effectivePort(), _timeout, connectionId_, _compress);
return p;
#endif
}
示例10: InfoI
public InfoI(EndpointI e)
{
_endpoint = e;
}
示例11: equivalent
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_);
}
示例12: 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;
}
示例13: acceptor
//
// Return an acceptor for this endpoint, or null if no acceptors
// is available. In case an acceptor is created, this operation
// also returns a new "effective" endpoint, which might differ
// from this endpoint, for example, if a dynamic port number is
// assigned.
//
public override Acceptor acceptor(ref EndpointI endpoint, string adapterName)
{
endpoint = null;
return null;
}
示例14: Acceptor
internal Acceptor(EndpointI endpoint, IceInternal.Acceptor acceptor)
{
_endpoint = endpoint;
_acceptor = acceptor;
}
示例15: 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);
}