本文整理汇总了C#中IceInternal.ProtocolInstance类的典型用法代码示例。如果您正苦于以下问题:C# ProtocolInstance类的具体用法?C# ProtocolInstance怎么用?C# ProtocolInstance使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProtocolInstance类属于IceInternal命名空间,在下文中一共展示了ProtocolInstance类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: StreamSocket
public StreamSocket(ProtocolInstance instance, Socket fd)
{
_fd = fd;
_state = StateConnected;
_desc = IceInternal.Network.fdToString(_fd);
init(instance);
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:7,代码来源:StreamSocket.cs
示例2: WSEndpoint
internal WSEndpoint(ProtocolInstance instance, EndpointI del, BasicStream s)
{
_instance = instance;
_delegate = (IPEndpointI)del;
_resource = s.readString();
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:7,代码来源:WSEndpoint.cs
示例3: TcpEndpointI
public TcpEndpointI(ProtocolInstance instance, string ho, int po, EndPoint sourceAddr, int ti, string conId,
bool co)
: base(instance, ho, po, sourceAddr, conId)
{
_timeout = ti;
_compress = co;
}
开发者ID:Crysty-Yui,项目名称:ice,代码行数:7,代码来源:TcpEndpointI.cs
示例4: UdpEndpointI
public UdpEndpointI(ProtocolInstance instance, string ho, int po, EndPoint sourceAddr, string mcastInterface,
int mttl, bool conn, string conId, bool co)
: base(instance, ho, po, sourceAddr, conId)
{
_mcastInterface = mcastInterface;
_mcastTtl = mttl;
_connect = conn;
_compress = co;
}
开发者ID:Crysty-Yui,项目名称:ice,代码行数:9,代码来源:UdpEndpointI.cs
示例5: IPEndpointI
public IPEndpointI(ProtocolInstance instance, string host, int port, EndPoint sourceAddr, string connectionId)
{
instance_ = instance;
host_ = host;
port_ = port;
sourceAddr_ = sourceAddr;
connectionId_ = connectionId;
_hashInitialized = false;
}
开发者ID:joshmoore,项目名称:ice,代码行数:9,代码来源:IPEndpointI.cs
示例6: UdpTransceiver
//
// Only for use by UdpConnector.
//
internal UdpTransceiver(ProtocolInstance instance, EndPoint addr, EndPoint sourceAddr, string mcastInterface,
int mcastTtl)
{
_instance = instance;
_addr = addr;
_sourceAddr = sourceAddr;
_readEventArgs = new SocketAsyncEventArgs();
_readEventArgs.RemoteEndPoint = _addr;
_readEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(ioCompleted);
_writeEventArgs = new SocketAsyncEventArgs();
_writeEventArgs.RemoteEndPoint = _addr;
_writeEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(ioCompleted);
_mcastInterface = mcastInterface;
_mcastTtl = mcastTtl;
_state = StateNeedConnect;
_incoming = false;
try
{
_fd = Network.createSocket(true, _addr.AddressFamily);
setBufSize(-1, -1);
Network.setBlock(_fd, false);
if(Network.isMulticast((IPEndPoint)_addr))
{
if(_mcastInterface.Length > 0)
{
Network.setMcastInterface(_fd, _mcastInterface, _addr.AddressFamily);
}
if(AssemblyUtil.osx_)
{
//
// On Windows, we delay the join for the mcast group after the connection
// establishment succeeds. This is necessary for older Windows versions
// where joining the group fails if the socket isn't bound. See ICE-5113.
//
Network.setMcastGroup(_fd, ((IPEndPoint)_addr).Address, _mcastInterface);
if(_mcastTtl != -1)
{
Network.setMcastTtl(_fd, _mcastTtl, _addr.AddressFamily);
}
}
}
}
catch(Ice.LocalException)
{
_fd = null;
throw;
}
}
开发者ID:externl,项目名称:ice,代码行数:55,代码来源:UdpTransceiver.cs
示例7: UdpEndpointI
public UdpEndpointI(ProtocolInstance instance, BasicStream s) :
base(instance, s)
{
if(s.getReadEncoding().Equals(Ice.Util.Encoding_1_0))
{
s.readByte();
s.readByte();
s.readByte();
s.readByte();
}
// Not transmitted.
//_connect = s.readBool();
_connect = false;
_compress = s.readBool();
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:15,代码来源:UdpEndpointI.cs
示例8: StreamSocket
public StreamSocket(ProtocolInstance instance, Socket fd)
{
_instance = instance;
_fd = fd;
_state = StateConnected;
try
{
_desc = IceInternal.Network.fdToString(_fd);
}
catch(Exception)
{
Network.closeSocketNoThrow(_fd);
throw;
}
init();
}
开发者ID:externl,项目名称:ice,代码行数:16,代码来源:StreamSocket.cs
示例9: TcpConnector
//
// 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;
IceInternal.HashUtil.hashAdd(ref _hashCode, _addr);
if(_sourceAddr != null)
{
IceInternal.HashUtil.hashAdd(ref _hashCode, _sourceAddr);
}
IceInternal.HashUtil.hashAdd(ref _hashCode, _timeout);
IceInternal.HashUtil.hashAdd(ref _hashCode, _connectionId);
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:22,代码来源:TcpConnector.cs
示例10: UdpConnector
//
// 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;
IceInternal.HashUtil.hashAdd(ref _hashCode, _addr);
if(sourceAddr != null)
{
IceInternal.HashUtil.hashAdd(ref _hashCode, _sourceAddr);
}
IceInternal.HashUtil.hashAdd(ref _hashCode, _mcastInterface);
IceInternal.HashUtil.hashAdd(ref _hashCode, _mcastTtl);
IceInternal.HashUtil.hashAdd(ref _hashCode, _connectionId);
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:23,代码来源:UdpConnector.cs
示例11: TcpAcceptor
internal TcpAcceptor(TcpEndpointI endpoint, ProtocolInstance instance, string host, int port)
{
_endpoint = endpoint;
_instance = instance;
_backlog = instance.properties().getPropertyAsIntWithDefault("Ice.TCP.Backlog", 511);
try
{
int protocol = _instance.protocolSupport();
_addr = (IPEndPoint)Network.getAddressForServer(host, port, protocol, _instance.preferIPv6());
_fd = Network.createServerSocket(false, _addr.AddressFamily, protocol);
Network.setBlock(_fd, false);
# if !COMPACT
Network.setTcpBufSize(_fd, _instance);
# endif
if(AssemblyUtil.platform_ != AssemblyUtil.Platform.Windows)
{
//
// Enable SO_REUSEADDR on Unix platforms to allow re-using the
// socket even if it's in the TIME_WAIT state. On Windows,
// this doesn't appear to be necessary and enabling
// SO_REUSEADDR would actually not be a good thing since it
// allows a second process to bind to an address even it's
// already bound by another process.
//
// TODO: using SO_EXCLUSIVEADDRUSE on Windows would probably
// be better but it's only supported by recent Windows
// versions (XP SP2, Windows Server 2003).
//
Network.setReuseAddress(_fd, true);
}
}
catch(System.Exception)
{
_fd = null;
throw;
}
}
开发者ID:Crysty-Yui,项目名称:ice,代码行数:38,代码来源:TcpAcceptor.cs
示例12: TcpTransceiver
//
// Only for use by TcpConnector, TcpAcceptor
//
internal TcpTransceiver(ProtocolInstance instance, StreamSocket stream)
{
_instance = instance;
_stream = stream;
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:8,代码来源:TcpTransceiver.cs
示例13: WSAcceptor
internal WSAcceptor(WSEndpoint endpoint, ProtocolInstance instance, Acceptor del)
{
_endpoint = endpoint;
_instance = instance;
_delegate = del;
}
开发者ID:Crysty-Yui,项目名称:ice,代码行数:6,代码来源:WSAcceptor.cs
示例14: Instance
//.........这里部分代码省略.........
const int defaultMessageSizeMax = 1024;
int num =
_initData.properties.getPropertyAsIntWithDefault("Ice.MessageSizeMax", defaultMessageSizeMax);
if(num < 1 || num > 0x7fffffff / 1024)
{
_messageSizeMax = 0x7fffffff;
}
else
{
_messageSizeMax = num * 1024; // Property is in kilobytes, _messageSizeMax in bytes
}
}
if(_initData.properties.getProperty("Ice.BatchAutoFlushSize").Length == 0 &&
_initData.properties.getProperty("Ice.BatchAutoFlush").Length > 0)
{
if(_initData.properties.getPropertyAsInt("Ice.BatchAutoFlush") > 0)
{
_batchAutoFlushSize = _messageSizeMax;
}
}
else
{
int num = _initData.properties.getPropertyAsIntWithDefault("Ice.BatchAutoFlushSize", 1024); // 1MB
if(num < 1)
{
_batchAutoFlushSize = num;
}
else if(num > 0x7fffffff / 1024)
{
_batchAutoFlushSize = 0x7fffffff;
}
else
{
_batchAutoFlushSize = num * 1024; // Property is in kilobytes, _batchAutoFlushSize in bytes
}
}
_cacheMessageBuffers = _initData.properties.getPropertyAsIntWithDefault("Ice.CacheMessageBuffers", 2);
_implicitContext = Ice.ImplicitContextI.create(_initData.properties.getProperty("Ice.ImplicitContext"));
_routerManager = new RouterManager();
_locatorManager = new LocatorManager(_initData.properties);
_referenceFactory = new ReferenceFactory(this, communicator);
_proxyFactory = new ProxyFactory(this);
_requestHandlerFactory = new RequestHandlerFactory(this);
bool isIPv6Supported = Network.isIPv6Supported();
bool ipv4 = _initData.properties.getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
bool ipv6 = _initData.properties.getPropertyAsIntWithDefault("Ice.IPv6", isIPv6Supported ? 1 : 0) > 0;
if(!ipv4 && !ipv6)
{
throw new Ice.InitializationException("Both IPV4 and IPv6 support cannot be disabled.");
}
else if(ipv4 && ipv6)
{
_protocolSupport = Network.EnableBoth;
}
else if(ipv4)
{
_protocolSupport = Network.EnableIPv4;
}
else
{
_protocolSupport = Network.EnableIPv6;
}
_preferIPv6 = _initData.properties.getPropertyAsInt("Ice.PreferIPv6Address") > 0;
_networkProxy = createNetworkProxy(_initData.properties, _protocolSupport);
_endpointFactoryManager = new EndpointFactoryManager(this);
ProtocolInstance tcpProtocolInstance = new ProtocolInstance(this, Ice.TCPEndpointType.value, "tcp");
EndpointFactory tcpEndpointFactory = new TcpEndpointFactory(tcpProtocolInstance);
_endpointFactoryManager.add(tcpEndpointFactory);
ProtocolInstance udpProtocolInstance =
new ProtocolInstance(this, Ice.UDPEndpointType.value, "udp");
EndpointFactory udpEndpointFactory = new UdpEndpointFactory(udpProtocolInstance);
_endpointFactoryManager.add(udpEndpointFactory);
ProtocolInstance wsProtocolInstance = new ProtocolInstance(this, Ice.WSEndpointType.value, "ws");
_endpointFactoryManager.add(new WSEndpointFactory(wsProtocolInstance,
tcpEndpointFactory.clone(wsProtocolInstance)));
#if !SILVERLIGHT
_pluginManager = new Ice.PluginManagerI(communicator);
#endif
_outgoingConnectionFactory = new OutgoingConnectionFactory(communicator, this);
_servantFactoryManager = new ObjectFactoryManager();
_objectAdapterFactory = new ObjectAdapterFactory(this, communicator);
_retryQueue = new RetryQueue(this);
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:101,代码来源:Instance.cs
示例15: init
private void init(ProtocolInstance instance, Transceiver del)
{
_instance = instance;
_delegate = del;
_state = StateInitializeDelegate;
_parser = new HttpParser();
_readState = ReadStateOpcode;
_readBuffer = new Buffer(ByteBuffer.ByteOrder.BIG_ENDIAN); // Network byte order
_readBufferSize = 1024;
_readLastFrame = true;
_readOpCode = 0;
_readHeaderLength = 0;
_readPayloadLength = 0;
_writeState = WriteStateHeader;
_writeBuffer = new Buffer(ByteBuffer.ByteOrder.BIG_ENDIAN); // Network byte order
_writeBufferSize = 1024;
_readPending = false;
_finishRead = false;
_writePending = false;
_readMask = new byte[4];
_writeMask = new byte[4];
_key = "";
_pingPayload = new byte[0];
_rand = new Random();
}
开发者ID:joshmoore,项目名称:ice,代码行数:25,代码来源:WSTransceiver.cs
示例16: WSTransceiver
internal WSTransceiver(ProtocolInstance instance, Transceiver del)
{
init(instance, del);
_host = "";
_port = -1;
_resource = "";
_incoming = true;
//
// Write and read buffer size must be large enough to hold the frame header!
//
Debug.Assert(_writeBufferSize > 256);
Debug.Assert(_readBufferSize > 256);
}
开发者ID:joshmoore,项目名称:ice,代码行数:14,代码来源:WSTransceiver.cs
示例17: TcpEndpointFactory
internal TcpEndpointFactory(ProtocolInstance instance)
{
_instance = instance;
}
开发者ID:Crysty-Yui,项目名称:ice,代码行数:4,代码来源:TcpEndpointI.cs
示例18: clone
public EndpointFactory clone(ProtocolInstance instance)
{
return new TcpEndpointFactory(instance);
}
开发者ID:Crysty-Yui,项目名称:ice,代码行数:4,代码来源:TcpEndpointI.cs
示例19: WSEndpoint
internal WSEndpoint(ProtocolInstance instance, EndpointI del, string res)
{
_instance = instance;
_delegate = (IPEndpointI)del;
_resource = res;
}
开发者ID:externl,项目名称:ice,代码行数:6,代码来源:WSEndpoint.cs
示例20: finishSetup
public void finishSetup(ref string[] args, Ice.Communicator communicator)
{
//
// Load plug-ins.
//
Debug.Assert(_serverThreadPool == null);
Ice.PluginManagerI pluginManagerImpl = (Ice.PluginManagerI)_pluginManager;
pluginManagerImpl.loadPlugins(ref args);
//
// Add WS and WSS endpoint factories if TCP/SSL factories are installed.
//
EndpointFactory tcpFactory = _endpointFactoryManager.get(Ice.TCPEndpointType.value);
if(tcpFactory != null)
{
ProtocolInstance instance = new ProtocolInstance(this, Ice.WSEndpointType.value, "ws", false);
_endpointFactoryManager.add(new WSEndpointFactory(instance, tcpFactory.clone(instance, null)));
}
EndpointFactory sslFactory = _endpointFactoryManager.get(Ice.SSLEndpointType.value);
if(sslFactory != null)
{
ProtocolInstance instance = new ProtocolInstance(this, Ice.WSSEndpointType.value, "wss", true);
_endpointFactoryManager.add(new WSEndpointFactory(instance, sslFactory.clone(instance, null)));
}
//
// Create Admin facets, if enabled.
//
// Note that any logger-dependent admin facet must be created after we load all plugins,
// since one of these plugins can be a Logger plugin that sets a new logger during loading
//
if(_initData.properties.getProperty("Ice.Admin.Enabled").Length == 0)
{
_adminEnabled = _initData.properties.getProperty("Ice.Admin.Endpoints").Length > 0;
}
else
{
_adminEnabled = _initData.properties.getPropertyAsInt("Ice.Admin.Enabled") > 0;
}
string[] facetFilter = _initData.properties.getPropertyAsList("Ice.Admin.Facets");
if(facetFilter.Length > 0)
{
foreach(string s in facetFilter)
{
_adminFacetFilter.Add(s);
}
}
if(_adminEnabled)
{
//
// Process facet
//
string processFacetName = "Process";
if(_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(processFacetName))
{
_adminFacets.Add(processFacetName, new ProcessI(communicator));
}
//
// Logger facet
//
string loggerFacetName = "Logger";
if(_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(loggerFacetName))
{
LoggerAdminLogger logger = new LoggerAdminLoggerI(_initData.properties, _initData.logger);
setLogger(logger);
_adminFacets.Add(loggerFacetName, logger.getFacet());
}
//
// Properties facet
//
string propertiesFacetName = "Properties";
PropertiesAdminI propsAdmin = null;
if(_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(propertiesFacetName))
{
propsAdmin= new PropertiesAdminI(this);
_adminFacets.Add(propertiesFacetName, propsAdmin);
}
//
// Metrics facet
//
string metricsFacetName = "Metrics";
if(_adminFacetFilter.Count == 0 || _adminFacetFilter.Contains(metricsFacetName))
{
CommunicatorObserverI observer = new CommunicatorObserverI(_initData);
_initData.observer = observer;
_adminFacets.Add(metricsFacetName, observer.getFacet());
//
// Make sure the admin plugin receives property updates.
//
if(propsAdmin != null)
{
propsAdmin.addUpdateCallback(observer.getFacet());
}
//.........这里部分代码省略.........
开发者ID:zhangwei5095,项目名称:ice,代码行数:101,代码来源:Instance.cs
注:本文中的IceInternal.ProtocolInstance类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论