本文整理汇总了C#中IceInternal.Instance.traceLevels方法的典型用法代码示例。如果您正苦于以下问题:C# Instance.traceLevels方法的具体用法?C# Instance.traceLevels怎么用?C# Instance.traceLevels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IceInternal.Instance
的用法示例。
在下文中一共展示了Instance.traceLevels方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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();
}
示例4: 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);
}
示例5: 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;
}
}
示例6: 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;
}
}
示例7: 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;
}
}
示例8: ThreadPool
public ThreadPool(Instance instance, string prefix, int timeout)
{
Ice.Properties properties = instance.initializationData().properties;
_instance = instance;
_dispatcher = instance.initializationData().dispatcher;
_destroyed = false;
_prefix = prefix;
_threadIndex = 0;
_inUse = 0;
_serialize = properties.getPropertyAsInt(_prefix + ".Serialize") > 0;
_serverIdleTime = timeout;
string programName = properties.getProperty("Ice.ProgramName");
if(programName.Length > 0)
{
_threadPrefix = programName + "-" + _prefix;
}
else
{
_threadPrefix = _prefix;
}
//
// We use just one thread as the default. This is the fastest
// possible setting, still allows one level of nesting, and
// doesn't require to make the servants thread safe.
//
int size = properties.getPropertyAsIntWithDefault(_prefix + ".Size", 1);
if(size < 1)
{
string s = _prefix + ".Size < 1; Size adjusted to 1";
_instance.initializationData().logger.warning(s);
size = 1;
}
int sizeMax = properties.getPropertyAsIntWithDefault(_prefix + ".SizeMax", size);
if(sizeMax < size)
{
string s = _prefix + ".SizeMax < " + _prefix + ".Size; SizeMax adjusted to Size (" + size + ")";
_instance.initializationData().logger.warning(s);
sizeMax = size;
}
int sizeWarn = properties.getPropertyAsInt(_prefix + ".SizeWarn");
if(sizeWarn != 0 && sizeWarn < size)
{
string s = _prefix + ".SizeWarn < " + _prefix + ".Size; adjusted SizeWarn to Size (" + size + ")";
_instance.initializationData().logger.warning(s);
sizeWarn = size;
}
else if(sizeWarn > sizeMax)
{
string s = _prefix + ".SizeWarn > " + _prefix + ".SizeMax; adjusted SizeWarn to SizeMax ("
+ sizeMax + ")";
_instance.initializationData().logger.warning(s);
sizeWarn = sizeMax;
}
int threadIdleTime = properties.getPropertyAsIntWithDefault(_prefix + ".ThreadIdleTime", 60);
if(threadIdleTime < 0)
{
string s = _prefix + ".ThreadIdleTime < 0; ThreadIdleTime adjusted to 0";
_instance.initializationData().logger.warning(s);
threadIdleTime = 0;
}
_size = size;
_sizeMax = sizeMax;
_sizeWarn = sizeWarn;
_threadIdleTime = threadIdleTime;
int stackSize = properties.getPropertyAsInt(_prefix + ".StackSize");
if(stackSize < 0)
{
string s = _prefix + ".StackSize < 0; Size adjusted to OS default";
_instance.initializationData().logger.warning(s);
stackSize = 0;
}
_stackSize = stackSize;
_hasPriority = properties.getProperty(_prefix + ".ThreadPriority").Length > 0;
_priority = IceInternal.Util.stringToThreadPriority(properties.getProperty(_prefix + ".ThreadPriority"));
if(!_hasPriority)
{
_hasPriority = properties.getProperty("Ice.ThreadPriority").Length > 0;
_priority = IceInternal.Util.stringToThreadPriority(properties.getProperty("Ice.ThreadPriority"));
}
if(_instance.traceLevels().threadPool >= 1)
{
string s = "creating " + _prefix + ": Size = " + _size + ", SizeMax = " + _sizeMax + ", SizeWarn = " +
_sizeWarn;
_instance.initializationData().logger.trace(_instance.traceLevels().threadPoolCat, s);
}
_workItems = new Queue<ThreadPoolWorkItem>();
try
{
_threads = new List<WorkerThread>();
//.........这里部分代码省略.........
示例9: TcpTransceiver
//
// Only for use by TcpConnector, TcpAcceptor
//
internal TcpTransceiver(Instance instance, Socket fd, EndPoint 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>";
#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
_maxSendPacketSize = Network.getSendBufferSize(fd);
if(_maxSendPacketSize < 512)
{
_maxSendPacketSize = 0;
}
_maxReceivePacketSize = Network.getRecvBufferSize(fd);
if(_maxReceivePacketSize < 512)
{
_maxReceivePacketSize = 0;
}
}
示例10: ObjectAdapterI
//.........这里部分代码省略.........
if(_routerInfo != null)
{
//
// Make sure this router is not already registered with another adapter.
//
if(_routerInfo.getAdapter() != null)
{
Ice.AlreadyRegisteredException ex = new Ice.AlreadyRegisteredException();
ex.kindOfObject = "object adapter with router";
ex.id = instance_.identityToString(router.ice_getIdentity());
throw ex;
}
//
// Add the router's server proxy endpoints to this object
// adapter.
//
EndpointI[] endpoints = _routerInfo.getServerEndpoints();
for(int i = 0; i < endpoints.Length; ++i)
{
_routerEndpoints.Add(endpoints[i]);
}
_routerEndpoints.Sort(); // Must be sorted.
//
// Remove duplicate endpoints, so we have a list of unique endpoints.
//
for(int i = 0; i < _routerEndpoints.Count-1;)
{
EndpointI e1 = _routerEndpoints[i];
EndpointI e2 = _routerEndpoints[i + 1];
if(e1.Equals(e2))
{
_routerEndpoints.RemoveAt(i);
}
else
{
++i;
}
}
//
// Associate this object adapter with the router. This way,
// new outgoing connections to the router's client proxy will
// use this object adapter for callbacks.
//
_routerInfo.setAdapter(this);
//
// Also modify all existing outgoing connections to the
// router's client proxy to use this object adapter for
// callbacks.
//
instance_.outgoingConnectionFactory().setRouterInfo(_routerInfo);
}
}
else
{
//
// Parse the endpoints, but don't store them in the adapter. The connection
// factory might change it, for example, to fill in the real port number.
//
List<EndpointI> endpoints = parseEndpoints(properties.getProperty(_name + ".Endpoints"), true);
foreach(EndpointI endp in endpoints)
{
IncomingConnectionFactory factory = new IncomingConnectionFactory(instance, endp, this);
_incomingConnectionFactories.Add(factory);
}
if(endpoints.Count == 0)
{
TraceLevels tl = instance_.traceLevels();
if(tl.network >= 2)
{
instance_.initializationData().logger.trace(tl.networkCat, "created adapter `" + _name +
"' without endpoints");
}
}
//
// Parse published endpoints.
//
_publishedEndpoints = parsePublishedEndpoints();
}
if(properties.getProperty(_name + ".Locator").Length > 0)
{
setLocator(LocatorPrxHelper.uncheckedCast(
instance_.proxyFactory().propertyToProxy(_name + ".Locator")));
}
else
{
setLocator(instance_.referenceFactory().getDefaultLocator());
}
}
catch(LocalException)
{
destroy();
throw;
}
}
示例11: 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;
}
}