本文整理汇总了C#中IceInternal.Instance.initializationData方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.initializationData方法的具体用法?C# Instance.initializationData怎么用?C# Instance.initializationData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IceInternal.Instance
的用法示例。
在下文中一共展示了Instance.initializationData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProtocolInstance
public ProtocolInstance(Instance instance, short type, string protocol)
{
instance_ = instance;
traceLevel_ = instance_.traceLevels().network;
traceCategory_ = instance_.traceLevels().networkCat;
logger_ = instance_.initializationData().logger;
properties_ = instance_.initializationData().properties;
type_ = type;
protocol_ = protocol;
}
示例2: ProtocolInstance
public ProtocolInstance(Ice.Communicator communicator, short type, string protocol, bool secure)
{
instance_ = Util.getInstance(communicator);
traceLevel_ = instance_.traceLevels().network;
traceCategory_ = instance_.traceLevels().networkCat;
logger_ = instance_.initializationData().logger;
properties_ = instance_.initializationData().properties;
type_ = type;
protocol_ = protocol;
secure_ = secure;
}
示例3: AsyncIOThread
internal AsyncIOThread(Instance instance)
{
_instance = instance;
_thread = new HelperThread(this);
if(instance.initializationData().properties.getProperty("Ice.ThreadPriority").Length > 0)
{
ThreadPriority priority = IceInternal.Util.stringToThreadPriority(
instance.initializationData().properties.getProperty("Ice.ThreadPriority"));
_thread.Start(priority);
}
else
{
_thread.Start(ThreadPriority.Normal);
}
}
示例4: TcpAcceptor
internal TcpAcceptor(Instance instance, string host, int port)
{
instance_ = instance;
_traceLevels = instance.traceLevels();
_logger = instance.initializationData().logger;
_backlog = instance.initializationData().properties.getPropertyAsIntWithDefault("Ice.TCP.Backlog", 511);
try
{
_addr = Network.getAddressForServer(host, port, instance_.protocolSupport());
_fd = Network.createSocket(false, _addr.AddressFamily);
Network.setBlock(_fd, false);
#if !COMPACT
Network.setTcpBufSize(_fd, instance_.initializationData().properties, _logger);
#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);
}
if(_traceLevels.network >= 2)
{
string s = "attempting to bind to tcp socket " + Network.addrToString(_addr);
_logger.trace(_traceLevels.networkCat, s);
}
_addr = Network.doBind(_fd, _addr);
}
catch(System.Exception)
{
_fd = null;
throw;
}
}
示例5: EndpointHostResolver
internal EndpointHostResolver(Instance instance)
{
_instance = instance;
_protocol = instance.protocolSupport();
_preferIPv6 = instance.preferIPv6();
_thread = new HelperThread(this);
updateObserver();
if(instance.initializationData().properties.getProperty("Ice.ThreadPriority").Length > 0)
{
ThreadPriority priority = IceInternal.Util.stringToThreadPriority(
instance.initializationData().properties.getProperty("Ice.ThreadPriority"));
_thread.Start(priority);
}
else
{
_thread.Start(ThreadPriority.Normal);
}
}
示例6: AsyncIOThread
internal AsyncIOThread(Instance instance)
{
_instance = instance;
_thread = new HelperThread(this);
updateObserver();
#if !SILVERLIGHT
if(instance.initializationData().properties.getProperty("Ice.ThreadPriority").Length > 0)
{
ThreadPriority priority = IceInternal.Util.stringToThreadPriority(
instance.initializationData().properties.getProperty("Ice.ThreadPriority"));
_thread.Start(priority);
}
else
{
_thread.Start(ThreadPriority.Normal);
}
#else
_thread.Start();
#endif
}
示例7: TcpConnector
//
// Only for use by TcpEndpoint
//
internal TcpConnector(Instance instance, IPEndPoint addr, int timeout, string connectionId)
{
_instance = instance;
_traceLevels = instance.traceLevels();
_logger = instance.initializationData().logger;
_addr = addr;
_timeout = timeout;
_connectionId = connectionId;
_hashCode = _addr.GetHashCode();
_hashCode = 5 * _hashCode + _timeout;
_hashCode = 5 * _hashCode + _connectionId.GetHashCode();
}
示例8: TcpTransceiver
//
// Only for use by TcpConnector, TcpAcceptor
//
internal TcpTransceiver(Instance instance, Socket fd, IPEndPoint addr, bool connected)
{
_fd = fd;
_addr = addr;
_traceLevels = instance.traceLevels();
_logger = instance.initializationData().logger;
_stats = instance.initializationData().stats;
_state = connected ? StateConnected : StateNeedConnect;
_desc = connected ? Network.fdToString(_fd) : "<not connected>";
_maxSendPacketSize = Network.getSendBufferSize(fd);
if(_maxSendPacketSize < 512)
{
_maxSendPacketSize = 0;
}
_maxReceivePacketSize = Network.getRecvBufferSize(fd);
if(_maxReceivePacketSize < 512)
{
_maxReceivePacketSize = 0;
}
}
示例9: UdpTransceiver
//
// Only for use by UdpConnector.
//
internal UdpTransceiver(Instance instance, IPEndPoint addr, string mcastInterface, int mcastTtl)
{
_traceLevels = instance.traceLevels();
_logger = instance.initializationData().logger;
_stats = instance.initializationData().stats;
_addr = addr;
_mcastInterface = mcastInterface;
_mcastTtl = mcastTtl;
_state = StateNeedConnect;
_incoming = false;
try
{
_fd = Network.createSocket(true, _addr.AddressFamily);
setBufSize(instance);
Network.setBlock(_fd, false);
}
catch(Ice.LocalException)
{
_fd = null;
throw;
}
}
示例10: get
static public InvocationObserver get(Instance instance, string op)
{
CommunicatorObserver obsv = instance.initializationData().observer;
if(obsv != null)
{
InvocationObserver observer = obsv.getInvocationObserver(null, op, _emptyContext);
if(observer != null)
{
observer.attach();
}
return observer;
}
return null;
}
示例11: TcpConnector
//
// Only for use by TcpEndpoint
//
internal TcpConnector(Instance instance, EndPoint addr, NetworkProxy proxy, int timeout, string connectionId)
{
_instance = instance;
_traceLevels = instance.traceLevels();
_logger = instance.initializationData().logger;
_addr = addr;
_proxy = proxy;
_timeout = timeout;
_connectionId = connectionId;
_hashCode = 5381;
IceInternal.HashUtil.hashAdd(ref _hashCode, _addr);
IceInternal.HashUtil.hashAdd(ref _hashCode, _timeout);
IceInternal.HashUtil.hashAdd(ref _hashCode, _connectionId);
}
示例12: ProxyFactory
//
// Only for use by Instance
//
internal ProxyFactory(Instance instance)
{
instance_ = instance;
string[] arr = instance_.initializationData().properties.getPropertyAsList("Ice.RetryIntervals");
if(arr.Length > 0)
{
_retryIntervals = new int[arr.Length];
for (int i = 0; i < arr.Length; i++)
{
int v;
try
{
v = System.Int32.Parse(arr[i], CultureInfo.InvariantCulture);
}
catch(System.FormatException)
{
v = 0;
}
//
// If -1 is the first value, no retry and wait intervals.
//
if(i == 0 && v == -1)
{
_retryIntervals = new int[0];
break;
}
_retryIntervals[i] = v > 0?v:0;
}
}
else
{
_retryIntervals = new int[1];
_retryIntervals[0] = 0;
}
}
示例13: BatchRequestQueue
public BatchRequestQueue(Instance instance, bool datagram)
{
Ice.InitializationData initData = instance.initializationData();
_interceptor = initData.batchRequestInterceptor;
_batchStreamInUse = false;
_batchRequestNum = 0;
_batchStream = new BasicStream(instance, Ice.Util.currentProtocolEncoding);
_batchStream.writeBlob(Protocol.requestBatchHdr);
_batchMarker = _batchStream.size();
_request = new BatchRequestI(this);
_maxSize = instance.batchAutoFlushSize();
if(_maxSize > 0 && datagram)
{
int udpSndSize = initData.properties.getPropertyAsIntWithDefault("Ice.UDP.SndSize",
65535 - _udpOverhead);
if(udpSndSize < _maxSize)
{
_maxSize = udpSndSize;
}
}
}
示例14: UdpEndpointI
//.........这里部分代码省略.........
{
Ice.EndpointParseException e = new Ice.EndpointParseException();
e.str = "unexpected argument `" + argument + "' provided for -c option in `udp " + str + "'";
throw e;
}
_connect = true;
}
else if(option.Equals("-z"))
{
if(argument != null)
{
Ice.EndpointParseException e = new Ice.EndpointParseException();
e.str = "unexpected argument `" + argument + "' provided for -z option in `udp " + str + "'";
throw e;
}
_compress = true;
}
else if(option.Equals("-v") || option.Equals("-e"))
{
if(argument == null)
{
Ice.EndpointParseException e = new Ice.EndpointParseException();
e.str = "no argument provided for " + option + " option in endpoint " + "`udp " + str + "'";
throw e;
}
try
{
Ice.EncodingVersion v = Ice.Util.stringToEncodingVersion(argument);
if(v.major != 1 || v.minor != 0)
{
instance_.initializationData().logger.warning("deprecated udp endpoint option: " + option);
}
}
catch(Ice.VersionParseException ex)
{
Ice.EndpointParseException e = new Ice.EndpointParseException();
e.str = "invalid version `" + argument + "' in endpoint `udp " + str + "':\n" + ex.str;
throw e;
}
}
else if(option.Equals("--interface"))
{
if(argument == null)
{
Ice.EndpointParseException e = new Ice.EndpointParseException();
e.str = "no argument provided for --interface option in endpoint `udp " + str + "'";
throw e;
}
_mcastInterface = argument;
}
else if(option.Equals("--ttl"))
{
if(argument == null)
{
Ice.EndpointParseException e = new Ice.EndpointParseException();
e.str = "no argument provided for --ttl option in endpoint `udp " + str + "'";
throw e;
}
try
{
_mcastTtl = System.Int32.Parse(argument, CultureInfo.InvariantCulture);
示例15: UdpTransceiver
//
// Only for use by UdpConnector.
//
internal UdpTransceiver(Instance instance, EndPoint addr, string mcastInterface, int mcastTtl)
{
_traceLevels = instance.traceLevels();
_logger = instance.initializationData().logger;
_stats = instance.initializationData().stats;
_addr = addr;
#if ICE_SOCKET_ASYNC_API
_readEventArgs = new SocketAsyncEventArgs();
_readEventArgs.RemoteEndPoint = _addr;
_readEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(ioCompleted);
_writeEventArgs = new SocketAsyncEventArgs();
_writeEventArgs.RemoteEndPoint = _addr;
_writeEventArgs.Completed += new EventHandler<SocketAsyncEventArgs>(ioCompleted);
#if SILVERLIGHT
String policy = instance.initializationData().properties.getProperty("Ice.ClientAccessPolicyProtocol");
if(policy.Equals("Http"))
{
_readEventArgs.SocketClientAccessPolicyProtocol = SocketClientAccessPolicyProtocol.Http;
_writeEventArgs.SocketClientAccessPolicyProtocol = SocketClientAccessPolicyProtocol.Http;
}
else if(!String.IsNullOrEmpty(policy))
{
_logger.warning("Ignoring invalid Ice.ClientAccessPolicyProtocol value `" + policy + "'");
}
#endif
#endif
_mcastInterface = mcastInterface;
_mcastTtl = mcastTtl;
_state = StateNeedConnect;
_incoming = false;
try
{
_fd = Network.createSocket(true, _addr.AddressFamily);
setBufSize(instance);
#if !SILVERLIGHT
Network.setBlock(_fd, false);
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.
//
if(Network.isMulticast((IPEndPoint)_addr))
{
Network.setMcastGroup(_fd, ((IPEndPoint)_addr).Address, _mcastInterface);
if(_mcastTtl != -1)
{
Network.setMcastTtl(_fd, _mcastTtl, _addr.AddressFamily);
}
}
}
#endif
}
catch(Ice.LocalException)
{
_fd = null;
throw;
}
}