本文整理汇总了C#中ITransport类的典型用法代码示例。如果您正苦于以下问题:C# ITransport类的具体用法?C# ITransport怎么用?C# ITransport使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITransport类属于命名空间,在下文中一共展示了ITransport类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ElasticClientFactory
public ElasticClientFactory(
IConnectionSettingsValues settings = null,
IConnection connection = null,
ITransport transport = null,
INestSerializer serializer = null) {
this.CreateClient(settings, connection, transport, serializer);
}
开发者ID:Polylytics,项目名称:dashing,代码行数:7,代码来源:ElasticClientFactory.cs
示例2: BusClient
public BusClient(ITransport transport, ISubscriptionKeyResolver keyResolver, IConfigurationContext configurationContext)
{
this.transport = transport;
this.keyResolver = keyResolver;
this.transport.InitializeForPublishing();
this.configurationContext = configurationContext;
}
开发者ID:WaveServiceBus,项目名称:WaveServiceBus,代码行数:7,代码来源:BusClient.cs
示例3: TransportAsyncWorker
// For send/receive
private TransportAsyncWorker(ITransport transport, OperationType operation, byte[] buffer, int offset, int size, AsyncCallback callback, object state)
: this(transport, operation, callback, state)
{
_buffer = buffer;
_offset = offset;
_size = size;
}
开发者ID:vadimskipin,项目名称:DVRemoting,代码行数:8,代码来源:TransportAsyncWorker.cs
示例4: Test
public static void Test(ITransport t, IQueueStrategy strategy,
Endpoint queueEndpoint, Action<Message> send, Func<MessageEnumerator>
enumer)
{
Guid id = Guid.NewGuid();
var serializer = new XmlMessageSerializer(new
DefaultReflection(), new DefaultKernel());
var subscriptionStorage = new MsmqSubscriptionStorage(new
DefaultReflection(),
serializer,
queueEndpoint.Uri,
new
EndpointRouter(),
strategy);
subscriptionStorage.Initialize();
var wait = new ManualResetEvent(false);
subscriptionStorage.SubscriptionChanged += () => wait.Set();
t.AdministrativeMessageArrived +=
subscriptionStorage.HandleAdministrativeMessage;
Message msg = new MessageBuilder
(serializer).GenerateMsmqMessageFromMessageBatch(new
AddInstanceSubscription
{
Endpoint = queueEndpoint.Uri.ToString(),
InstanceSubscriptionKey = id,
Type = typeof (TestMessage2).FullName,
});
send(msg);
wait.WaitOne();
msg = new MessageBuilder
(serializer).GenerateMsmqMessageFromMessageBatch(new
RemoveInstanceSubscription
{
Endpoint = queueEndpoint.Uri.ToString(),
InstanceSubscriptionKey = id,
Type = typeof (TestMessage2).FullName,
});
wait.Reset();
send(msg);
wait.WaitOne();
IEnumerable<Uri> uris = subscriptionStorage
.GetSubscriptionsFor(typeof (TestMessage2));
Assert.Equal(0, uris.Count());
int count = 0;
MessageEnumerator copy = enumer();
while (copy.MoveNext()) count++;
Assert.Equal(0, count);
}
开发者ID:philiphoy,项目名称:rhino-esb,代码行数:60,代码来源:FIeldProblem_Nick.cs
示例5: ExecuteOperation
public Dictionary<string, string> ExecuteOperation(ITransport transport)
{
//Defines a new Dictonary which is capable of storing indexed string values with a string index.
Dictionary<string, string> result;
//Writes the request header
HeaderParams param = WriteHeader(transport, STATS_REQUEST);
transport.Flush();
ReadHeaderAndValidate(transport, param);
//reads the number of statistic details sent from server
int numberOfStats = transport.ReadVInt();
if (logger.IsTraceEnabled)
logger.Trace("Number of Stats : " + numberOfStats);
result = new Dictionary<string, string>();
//reads all statistics and add them to the 'result' dictionary
for (int i = 0; i < numberOfStats; i++)
{
String statName = transport.ReadString();
if (logger.IsTraceEnabled)
logger.Trace("Stat Name Recieved : " + statName);
String statValue = transport.ReadString();
if (logger.IsTraceEnabled)
logger.Trace("Stat ValueRecieved : " + statName);
result.Add(statName, statValue);
}
return result;
}
开发者ID:sunimalr,项目名称:dotnet-client,代码行数:26,代码来源:StatsOperation.cs
示例6: ThreadPoolWorkerFactory
/// <summary>
/// Creates the worker factory
/// </summary>
public ThreadPoolWorkerFactory(ITransport transport, IRebusLoggerFactory rebusLoggerFactory, IPipeline pipeline, IPipelineInvoker pipelineInvoker, Options options, Func<RebusBus> busGetter, BusLifetimeEvents busLifetimeEvents, ISyncBackoffStrategy backoffStrategy)
{
if (transport == null) throw new ArgumentNullException(nameof(transport));
if (rebusLoggerFactory == null) throw new ArgumentNullException(nameof(rebusLoggerFactory));
if (pipeline == null) throw new ArgumentNullException(nameof(pipeline));
if (pipelineInvoker == null) throw new ArgumentNullException(nameof(pipelineInvoker));
if (options == null) throw new ArgumentNullException(nameof(options));
if (busGetter == null) throw new ArgumentNullException(nameof(busGetter));
if (busLifetimeEvents == null) throw new ArgumentNullException(nameof(busLifetimeEvents));
if (backoffStrategy == null) throw new ArgumentNullException(nameof(backoffStrategy));
_transport = transport;
_rebusLoggerFactory = rebusLoggerFactory;
_pipeline = pipeline;
_pipelineInvoker = pipelineInvoker;
_options = options;
_busGetter = busGetter;
_backoffStrategy = backoffStrategy;
_parallelOperationsManager = new ParallelOperationsManager(options.MaxParallelism);
_log = _rebusLoggerFactory.GetCurrentClassLogger();
if (_options.MaxParallelism < 1)
{
throw new ArgumentException($"Max parallelism is {_options.MaxParallelism} which is an invalid value");
}
if (options.WorkerShutdownTimeout < TimeSpan.Zero)
{
throw new ArgumentOutOfRangeException($"Cannot use '{options.WorkerShutdownTimeout}' as worker shutdown timeout as it");
}
busLifetimeEvents.WorkersStopped += WaitForContinuationsToFinish;
}
开发者ID:xenoputtss,项目名称:Rebus,代码行数:35,代码来源:ThreadPoolWorkerFactory.cs
示例7: CachedTransport
public CachedTransport(string email, ITransport innerTranport)
{
userCacheService = new CacheService(email);
commonCacheService = new CacheService();
this.innerTranport = innerTranport;
this.innerTranport.Throttled += instance_Throttled;
}
开发者ID:keeper,项目名称:Procurement,代码行数:7,代码来源:CachedTransport.cs
示例8: DockingViewManager
public DockingViewManager(ITransport transport, IAdapter adapter, IScheduler scheduler, LocalScheduler dispatcher)
{
_transport = transport;
_adapter = adapter;
_scheduler = scheduler;
_dispatcher = dispatcher;
}
开发者ID:jqd072014,项目名称:code.root,代码行数:7,代码来源:DockingViewManager.cs
示例9: AbstractInterceptor
protected AbstractInterceptor(ITransport transport, IKernel kernel, ISerializer serializer, TimeoutManager timeoutManager)
{
m_transport = transport;
m_kernel = kernel;
m_serializer = serializer;
m_timeoutManager = timeoutManager;
}
开发者ID:OmerMor,项目名称:Messageless,代码行数:7,代码来源:AbstractInterceptor.cs
示例10: GetWrapper
public static IAsyncTransport GetWrapper(ITransport transport)
{
// determine whether transport supports async operations and construct wrapper if not
return transport is IAsyncTransport
? (IAsyncTransport)transport
: new TransportAsyncWrapper(transport);
}
开发者ID:vadimskipin,项目名称:DVRemoting,代码行数:7,代码来源:TransportAsyncWrapper.cs
示例11: OnInterrupted
protected virtual void OnInterrupted(ITransport sender)
{
if(this.interruptedHandler != null)
{
this.interruptedHandler(sender);
}
}
开发者ID:Redi0,项目名称:meijing-ui,代码行数:7,代码来源:TransportFilter.cs
示例12: Init
public void Init()
{
endpointTransport = Configure.Instance.Builder.Build<ITransport>();
endpointTransport.FinishedMessageProcessing += (x, y) => SendReadyMessage(false);
var bus = Configure.Instance.Builder.Build<IStartableBus>();
bus.Started += (x, y) =>
{
SendReadyMessage(true);
controlTransport.Start(ControlQueue);
};
endpointBus = Configure.Instance.Builder.Build<IBus>();
controlTransport = new TransactionalTransport
{
IsTransactional = true,
FailureManager = Configure.Instance.Builder.Build<IManageMessageFailures>(),
MessageReceiver = new MsmqMessageReceiver(),
MaxRetries = 1,
NumberOfWorkerThreads = NumberOfWorkerThreads
};
var serializer = Configure.Instance.Builder.Build<IMessageSerializer>();
controlTransport.TransportMessageReceived +=
(obj, ev) =>
{
var messages = serializer.Deserialize(new MemoryStream(ev.Message.Body));
foreach (var msg in messages)
if (msg is ReadyMessage)
Handle(msg as ReadyMessage, ev.Message.ReturnAddress);
};
}
开发者ID:Jpattom,项目名称:NServiceBus,代码行数:34,代码来源:ReadyMessageManager.cs
示例13: OnResumed
protected virtual void OnResumed(ITransport sender)
{
if(this.resumedHandler != null)
{
this.resumedHandler(sender);
}
}
开发者ID:Redi0,项目名称:meijing-ui,代码行数:7,代码来源:TransportFilter.cs
示例14: DurationTraderViewModelController
public DurationTraderViewModelController(ITransport transport, IAdapter adapter, IScheduler scheduler, LocalScheduler dispatcher)
{
transport.GetTradingObservables()
.SubscribeOn(scheduler)
.ObserveOn(dispatcher)
.Subscribe(fSet => adapter.updater(fSet, ViewModel));
}
开发者ID:jqd072014,项目名称:code.root,代码行数:7,代码来源:DurationTraderViewModelController.cs
示例15: TransportWrapper
public TransportWrapper(ITransport transport)
{
if (transport == null)
throw new ArgumentNullException("transport");
_transport = transport;
_serviceManager = new ServiceManager<TransportWrapper>("SendGrid Service", "Email Services");
}
开发者ID:alexed1,项目名称:dtrack,代码行数:7,代码来源:TransportWrapper.cs
示例16: OnFrame
internal bool OnFrame(ITransport transport, ByteBuffer buffer, out SaslCode code)
{
ushort channel;
DescribedList command;
Frame.GetFrame(buffer, out channel, out command);
Trace.WriteLine(TraceLevel.Frame, "RECV {0}", command);
bool shouldContinue = true;
if (command.Descriptor.Code == Codec.SaslOutcome.Code)
{
code = ((SaslOutcome)command).Code;
shouldContinue = false;
}
else
{
code = SaslCode.Ok;
DescribedList response = this.OnCommand(command);
if (response != null)
{
this.SendCommand(transport, response);
shouldContinue = response.Descriptor.Code != Codec.SaslOutcome.Code;
}
}
return shouldContinue;
}
开发者ID:rajeshganesh,项目名称:amqpnetlite,代码行数:26,代码来源:SaslProfile.cs
示例17: SetUp
public void SetUp()
{
mockRepository = new MockRepository();
mainTransport = mockRepository.StrictMultiMock<ITransport>();
mainTransport.Replay();
retryingTransport = new RetryingTransport(new SilentLogger(), mainTransport, retryCount, retryDelay);
}
开发者ID:palpha,项目名称:EasyGelf,代码行数:7,代码来源:RetryTransportTests.cs
示例18: OnCommand
protected override void OnCommand(ITransport sender, Command command)
{
if ( command.IsWireFormatInfo )
{
WireFormatInfo info = (WireFormatInfo)command;
try
{
if (!info.Valid)
{
throw new IOException("Remote wire format magic is invalid");
}
wireInfoSentDownLatch.await(negotiateTimeout);
wireFormat.RenegotiateWireFormat(info);
}
catch (Exception e)
{
OnException(this, e);
}
finally
{
readyCountDownLatch.countDown();
}
}
this.commandHandler(sender, command);
}
开发者ID:Redi0,项目名称:meijing-ui,代码行数:25,代码来源:WireFormatNegotiator.cs
示例19: MessageHandler
public MessageHandler(IKernel kernel, ITransport transport, ISerializer serializer, TimeoutManager timeoutManager)
{
m_kernel = kernel;
m_transport = transport;
m_serializer = serializer;
m_timeoutManager = timeoutManager;
}
开发者ID:OmerMor,项目名称:Messageless,代码行数:7,代码来源:MessageHandler.cs
示例20: Init
public void Init(ITransport transport)
{
transport.MessageSerializationException += Transport_OnMessageSerializationException;
transport.MessageProcessingFailure += Transport_OnMessageProcessingFailure;
transport.MessageProcessingCompleted += Transport_OnMessageProcessingCompleted;
transport.MessageArrived += Transport_OnMessageArrived;
}
开发者ID:BclEx,项目名称:rhino-esb,代码行数:7,代码来源:ErrorAction.cs
注:本文中的ITransport类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论