本文整理汇总了C#中IMessageSender.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# IMessageSender.Initialize方法的具体用法?C# IMessageSender.Initialize怎么用?C# IMessageSender.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMessageSender
的用法示例。
在下文中一共展示了IMessageSender.Initialize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeClient
public virtual void InitializeClient(ClientConfig clientConfig)
{
_mClientConfig = clientConfig ?? new ClientConfig();
_mHostName = NetworkInterfaceManager.GetLocalHostName();
_mStatistics = new DefaultMessageStatistics();
_mSender = new TcpMessageSender(_mClientConfig, _mStatistics);
_mSender.Initialize();
_mFactory = new MessageIdFactory();
_mStatusUpdateTask = new StatusUpdateTask(_mStatistics);
// initialize domain and ip address
_mFactory.Initialize(_mClientConfig.Domain.Id);
// start status update task
ThreadPool.QueueUserWorkItem(_mStatusUpdateTask.Run);
Logger.Info("Thread(StatusUpdateTask) started.");
}
示例2: InitializeClient
public virtual void InitializeClient(ClientConfig clientConfig)
{
_clientConfig = clientConfig ?? new ClientConfig();
_hostName = NetworkInterfaceManager.GetLocalHostName();
_statistics = new DefaultMessageStatistics();
_sender = new TcpMessageSender(_clientConfig, _statistics);
_sender.Initialize();
_factory = new MessageIdFactory();
_statusUpdateTask = new StatusUpdateTask(_statistics);
_taggedTransactions = new ConcurrentDictionary<string, ITaggedTransaction>();
// initialize domain and ip address
_factory.Initialize(_clientConfig.Domain.Id);
// start status update task
ThreadPool.QueueUserWorkItem(_statusUpdateTask.Run);
Logger.Info("Thread(StatusUpdateTask) started.");
}
示例3: Initialize
public virtual void Initialize(AbstractClientConfig clientConfig)
{
_mClientConfig = clientConfig;
_mStatistics = new DefaultMessageStatistics();
_mFactory = new MessageIdFactory();
// initialize domain and ip address
_mFactory.Initialize(_mClientConfig.Domain.Id);
_mSender = new TcpMessageSender(_mClientConfig, _mStatistics, _mFactory);
_mSender.Initialize();
_mStatusUpdateTask = new StatusUpdateTask(_mStatistics, _mClientConfig);
_mTaggedTransactions = new LRUCache<string, ITaggedTransaction>(CatConstants.TAGGED_TRANSACTION_CACHE_SIZE);
// start status update task
Thread statusUpdateTask = new Thread(_mStatusUpdateTask.Run);
statusUpdateTask.IsBackground = true;
statusUpdateTask.Start();
Logger.Info("Thread(StatusUpdateTask) started.");
}