Class AmqpObject
The base class of all AMQP objects. Connection Session SenderLink ReceiverLink
Implements
Inherited Members
Namespace: Amqp
Assembly: Amqp.Net.dll
Syntax
public abstract class AmqpObject : IAmqpObject
Properties
Error
Gets the last Error, if any, of the object.
Declaration
public Error Error { get; }
Property Value
Type | Description |
---|---|
Error |
IsClosed
Gets a boolean value indicating if the object has been closed.
Declaration
public bool IsClosed { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddClosedCallback(ClosedCallback)
Adds a callback to be called when the object is called. This method guarantees that the callback is invoked even if it is registered after the object is closed.
Declaration
public void AddClosedCallback(ClosedCallback callback)
Parameters
Type | Name | Description |
---|---|---|
ClosedCallback | callback | The callback to be invoked. |
Close()
Closes the AMQP object. It waits until a response is received from the peer, or throws TimeoutException after a default timeout.
Declaration
public void Close()
Close(TimeSpan, Error)
Closes the AMQP object with the specified error.
Declaration
public void Close(TimeSpan timeout, Error error = null)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeout | The duration to block until a closing frame is received from the peer. If it is TimeSpan.Zero, the call is non-blocking. |
Error | error | The AMQP Error to send to the peer, indicating why the object is being closed. |
CloseAsync()
Closes an AMQP object asynchronously using a default timeout.
Declaration
public Task CloseAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task for the asynchronous close operation. |
CloseAsync(TimeSpan, Error)
Closes an AMQP object asynchronously.
Declaration
public Task CloseAsync(TimeSpan timeout, Error error = null)
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | timeout | The time to wait for the task to complete. Refer to AmqpObject.Close for details. |
Error | error | The AMQP Error to send to the peer, indicating why the object is being closed. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A Task for the asynchronous close operation. |
OnClose(Error)
When overridden in a derived class, performs the actual close operation required by the object.
Declaration
protected abstract bool OnClose(Error error)
Parameters
Type | Name | Description |
---|---|---|
Error | error | The Error for closing the object. |
Returns
Type | Description |
---|---|
System.Boolean | A boolean value indicating if the object has been fully closed. |
Events
Closed
Gets the event used to notify that the object is closed. Callbacks may not be invoked if they are registered after the object is closed. It is recommend to call AddClosedCallback method.
Declaration
public event ClosedCallback Closed
Event Type
Type | Description |
---|---|
ClosedCallback |