本文整理汇总了C#中IModel.Abort方法的典型用法代码示例。如果您正苦于以下问题:C# IModel.Abort方法的具体用法?C# IModel.Abort怎么用?C# IModel.Abort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IModel
的用法示例。
在下文中一共展示了IModel.Abort方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMessage
/// <summary>
/// Called when [message].
/// </summary>
/// <param name="message">The message.</param>
/// <param name="channel">The channel.</param>
/// <remarks></remarks>
public void OnMessage(Message message, IModel channel)
{
var value = Encoding.UTF8.GetString(message.Body);
logger.Debug("Receiving: " + value);
if (this.failed.CompareAndSet(false, true))
{
// intentional error (causes exception on connection thread):
channel.Abort();
}
else
{
this.latch.Signal();
}
}
开发者ID:DonMcRae,项目名称:spring-net-amqp,代码行数:20,代码来源:MessageListenerRecoveryCachingConnectionIntegrationTests.cs
示例2: Close
protected virtual void Close(IModel channel, ConnectionState state, Exception exception = null)
{
this.CurrentState = ConnectionState.Closing;
if (channel != null)
{
Log.Debug("Aborting operations on temporary channel.");
channel.Abort();
}
if (this.connection != null)
{
Log.Debug("Blocking up to {0} ms before forcing the existing connection to close.", this.shutdownTimeout);
// calling connection.TryDispose() can thrown while connection.Abort() closes without throwing
this.connection.Abort(this.shutdownTimeout);
}
this.connection = null;
this.CurrentState = state;
if (exception != null)
throw new ChannelConnectionException(exception.Message, exception);
}
示例3: OnMessage
/// <summary>Called when [message].</summary>
/// <param name="message">The message.</param>
/// <param name="channel">The channel.</param>
public void OnMessage(Message message, IModel channel)
{
var value = Encoding.UTF8.GetString(message.Body);
Logger.Debug(m => m("Receiving: {0}", value));
if (this.failed.CompareAndSet(false, true))
{
// intentional error (causes exception on connection thread):
channel.Abort();
}
else
{
if (this.latch.CurrentCount > 0)
{
this.latch.Signal();
Logger.Debug(m => m("Latch Count: {0}", this.latch.CurrentCount));
}
}
}
开发者ID:yonglehou,项目名称:spring-net-amqp,代码行数:21,代码来源:MessageListenerRecoveryCachingConnectionIntegrationTests.cs
示例4: Close
protected virtual void Close(IModel channel, ConnectionState state, Exception exception = null)
{
this.CurrentState = ConnectionState.Closing;
if (channel != null)
{
Log.Debug("Aborting operations on temporary channel.");
channel.Abort();
}
this.TryAbortConnection();
this.connection = null;
this.CurrentState = state;
if (exception != null)
throw new ChannelConnectionException(exception.Message, exception);
}