本文整理汇总了C#中ITransport.Oneway方法的典型用法代码示例。如果您正苦于以下问题:C# ITransport.Oneway方法的具体用法?C# ITransport.Oneway怎么用?C# ITransport.Oneway使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITransport
的用法示例。
在下文中一共展示了ITransport.Oneway方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RestoreTransport
protected void RestoreTransport(ITransport t)
{
Tracer.Info("Restoring previous transport connection.");
t.Start();
// Send information to the broker - informing it we are a fault tolerant client
t.Oneway(new ConnectionControl() { FaultTolerant = true });
stateTracker.DoRestore(t);
Tracer.Info("Sending queued commands...");
Dictionary<int, Command> tmpMap = null;
lock(((ICollection) requestMap).SyncRoot)
{
tmpMap = new Dictionary<int, Command>(requestMap);
}
foreach(Command command in tmpMap.Values)
{
if(command.IsMessageAck)
{
Tracer.Debug("Stored MessageAck being dropped as stale.");
OnCommand(this, new Response() { CorrelationId = command.CommandId });
continue;
}
t.Oneway(command);
}
}
示例2: DoRestoreTempDestinations
/// <summary>
/// </summary>
/// <param name="transport"></param>
/// <param name="connectionState"></param>
protected void DoRestoreTempDestinations(ITransport transport, ConnectionState connectionState)
{
// Restore the connection's temp destinations.
foreach(DestinationInfo destinationInfo in connectionState.TempDestinations)
{
transport.Oneway(destinationInfo);
}
}
示例3: DoRestoreTransactions
private void DoRestoreTransactions(ITransport transport, ConnectionState connectionState)
{
AtomicCollection<TransactionState> transactionStates = connectionState.TransactionStates;
foreach(TransactionState transactionState in transactionStates)
{
foreach(Command command in transactionState.Commands)
{
transport.Oneway(command);
}
}
}
示例4: DoRestoreProducers
/// <summary>
/// </summary>
/// <param name="transport"></param>
/// <param name="sessionState"></param>
protected void DoRestoreProducers(ITransport transport, SessionState sessionState)
{
// Restore the session's producers
foreach(ProducerState producerState in sessionState.ProducerStates)
{
transport.Oneway(producerState.Info);
}
}
示例5: DoRestoreSessions
/// <summary>
/// </summary>
/// <param name="transport"></param>
/// <param name="connectionState"></param>
protected void DoRestoreSessions(ITransport transport, ConnectionState connectionState)
{
// Restore the connection's sessions
foreach(SessionState sessionState in connectionState.SessionStates)
{
transport.Oneway(sessionState.Info);
if(RestoreProducers)
{
DoRestoreProducers(transport, sessionState);
}
if(RestoreConsumers)
{
DoRestoreConsumers(transport, sessionState);
}
}
}
示例6: DoRestore
public void DoRestore(ITransport transport)
{
// Restore the connections.
foreach(ConnectionState connectionState in connectionStates.Values)
{
ConnectionInfo info = connectionState.Info;
info.FailoverReconnect = true;
transport.Oneway(info);
DoRestoreTempDestinations(transport, connectionState);
if(RestoreSessions)
{
DoRestoreSessions(transport, connectionState);
}
if(RestoreTransaction)
{
DoRestoreTransactions(transport, connectionState);
}
}
//now flush messages
foreach(Message msg in messageCache.Values)
{
transport.Oneway(msg);
}
}
示例7: DoRestoreConsumers
/// <summary>
/// </summary>
/// <param name="transport"></param>
/// <param name="sessionState"></param>
protected void DoRestoreConsumers(ITransport transport, SessionState sessionState)
{
// Restore the session's consumers but possibly in pull only (prefetch 0 state) till
// recovery completes.
ConnectionState connectionState = connectionStates[sessionState.Info.SessionId.ParentId];
bool connectionInterruptionProcessingComplete =
connectionState.ConnectionInterruptProcessingComplete;
// Restore the session's consumers
foreach(ConsumerState consumerState in sessionState.ConsumerStates)
{
ConsumerInfo infoToSend = consumerState.Info;
if(!connectionInterruptionProcessingComplete && infoToSend.PrefetchSize > 0 && transport.WireFormat.Version > 5)
{
infoToSend = consumerState.Info.Clone() as ConsumerInfo;
connectionState.RecoveringPullConsumers.Add(infoToSend.ConsumerId, consumerState.Info);
infoToSend.PrefetchSize = 0;
if(Tracer.IsDebugEnabled)
{
Tracer.Debug("restore consumer: " + infoToSend.ConsumerId +
" in pull mode pending recovery, overriding prefetch: " +
consumerState.Info.PrefetchSize);
}
}
if(Tracer.IsDebugEnabled)
{
Tracer.Debug("restore consumer: " + infoToSend.ConsumerId);
}
transport.Oneway(infoToSend);
}
}
示例8: ConnectionInterruptProcessingComplete
public void ConnectionInterruptProcessingComplete(ITransport transport, ConnectionId connectionId)
{
ConnectionState connectionState = connectionStates[connectionId];
if(connectionState != null)
{
connectionState.ConnectionInterruptProcessingComplete = true;
Dictionary<ConsumerId, ConsumerInfo> stalledConsumers = connectionState.RecoveringPullConsumers;
foreach(KeyValuePair<ConsumerId, ConsumerInfo> entry in stalledConsumers)
{
ConsumerControl control = new ConsumerControl();
control.ConsumerId = entry.Key;
control.Prefetch = entry.Value.PrefetchSize;
control.Destination = entry.Value.Destination;
try
{
if(Tracer.IsDebugEnabled)
{
Tracer.Debug("restored recovering consumer: " + control.ConsumerId +
" with: " + control.Prefetch);
}
transport.Oneway(control);
}
catch(Exception ex)
{
if(Tracer.IsDebugEnabled)
{
Tracer.Debug("Failed to submit control for consumer: " + control.ConsumerId +
" with: " + control.Prefetch + "Error: " + ex.Message);
}
}
}
stalledConsumers.Clear();
}
}
示例9: ConnectionInterruptProcessingComplete
public void ConnectionInterruptProcessingComplete(ITransport transport, ConnectionId connectionId)
{
ConnectionState connectionState = null;
if(connectionStates.TryGetValue(connectionId, out connectionState))
{
connectionState.ConnectionInterruptProcessingComplete = true;
lock(((ICollection) connectionState.RecoveringPullConsumers).SyncRoot)
{
foreach(KeyValuePair<ConsumerId, ConsumerInfo> entry in connectionState.RecoveringPullConsumers)
{
ConsumerControl control = new ConsumerControl();
control.ConsumerId = entry.Key;
control.Prefetch = entry.Value.PrefetchSize;
control.Destination = entry.Value.Destination;
try
{
if(Tracer.IsDebugEnabled)
{
Tracer.Debug("restored recovering consumer: " + control.ConsumerId +
" with: " + control.Prefetch);
}
transport.Oneway(control);
}
catch(Exception ex)
{
if(Tracer.IsDebugEnabled)
{
Tracer.Debug("Failed to submit control for consumer: " + control.ConsumerId +
" with: " + control.Prefetch + "Error: " + ex.Message);
}
}
}
connectionState.RecoveringPullConsumers.Clear();
}
}
}
示例10: disposeOf
protected void disposeOf(ITransport transport, ProducerInfo producer)
{
transport.Oneway(new RemoveInfo() { ObjectId = producer.ProducerId });
}