C# Class Amqp.Listener.ListenerLink

The listener link provides non-blocking methods that can be used by brokers/listener applications.
Inheritance: Link
Show file Open project: xamarin/mini-hacks Class Usage Examples

Public Methods

Method Description
CompleteAttach ( Amqp.Framing.Attach attach, Error error ) : void

Completes the link attach request. This should be called when the IContainer.AttachLink implementation returns false and the asynchrounous processing completes.

DisposeMessage ( Message message, Amqp.Framing.DeliveryState deliveryState, bool settled ) : void

Sends a disposition for the message.

InitializeReceiver ( uint credit, Action onMessage, object state ) : void

Initializes the receiver state for the link.

InitializeSender ( object>.Action onCredit, Action onDispose, object state ) : void

Initializes the sender state for the link.

ListenerLink ( Amqp.Listener.ListenerSession session, Amqp.Framing.Attach attach ) : System

Initializes a listener link object.

SendMessage ( Message message ) : void

Sends a message. This call is non-blocking and it does not wait for acknowledgements.

SendMessage ( Message message, System.ByteBuffer buffer ) : void

Sends a message with an optional buffer as the message payload.

SetCredit ( int credit, bool drain, bool autoRestore = true ) : void

Sets a credit on the link. A flow is sent to the peer to update link flow control state.

Protected Methods

Method Description
OnAbort ( Error error ) : void

Aborts the link.

OnClose ( Error error ) : bool

Closes the link.

Private Methods

Method Description
DeliverMessage ( Delivery delivery ) : void
InitializeLinkEndpoint ( Amqp.Listener.LinkEndpoint linkEndpoint, uint credit ) : void
OnAttach ( uint remoteHandle, Amqp.Framing.Attach attach ) : void
OnDeliveryStateChanged ( Delivery delivery ) : void
OnFlow ( Amqp.Framing.Flow flow ) : void
OnTransfer ( Delivery delivery, Amqp.Framing.Transfer transfer, System.ByteBuffer buffer ) : void
ThrowIfNotNull ( object obj, string name ) : void

Method Details

CompleteAttach() public method

Completes the link attach request. This should be called when the IContainer.AttachLink implementation returns false and the asynchrounous processing completes.
public CompleteAttach ( Amqp.Framing.Attach attach, Error error ) : void
attach Amqp.Framing.Attach The attach to send back.
error Error The error, if any, for the link.
return void

DisposeMessage() public method

Sends a disposition for the message.
public DisposeMessage ( Message message, Amqp.Framing.DeliveryState deliveryState, bool settled ) : void
message Message The message to be disposed (a disposition performative will be sent for this message).
deliveryState Amqp.Framing.DeliveryState The delivery state to set on disposition.
settled bool The settled flag on disposition.
return void

InitializeReceiver() public method

Initializes the receiver state for the link.
public InitializeReceiver ( uint credit, Action onMessage, object state ) : void
credit uint The link credit to send to the peer.
onMessage Action The callback to be invoked for received messages.
state object The user state attached to the link.
return void

InitializeSender() public method

Initializes the sender state for the link.
public InitializeSender ( object>.Action onCredit, Action onDispose, object state ) : void
onCredit object>.Action The callback to be invoked when delivery limit changes (by received flow performatives).
onDispose Action The callback to be invoked when disposition is received.
state object The user state attached to the link.
return void

ListenerLink() public method

Initializes a listener link object.
public ListenerLink ( Amqp.Listener.ListenerSession session, Amqp.Framing.Attach attach ) : System
session Amqp.Listener.ListenerSession The session.
attach Amqp.Framing.Attach The received attach frame.
return System

OnAbort() protected method

Aborts the link.
protected OnAbort ( Error error ) : void
error Error The error.
return void

OnClose() protected method

Closes the link.
protected OnClose ( Error error ) : bool
error Error The error
return bool

SendMessage() public method

Sends a message. This call is non-blocking and it does not wait for acknowledgements.
public SendMessage ( Message message ) : void
message Message
return void

SendMessage() public method

Sends a message with an optional buffer as the message payload.
public SendMessage ( Message message, System.ByteBuffer buffer ) : void
message Message The message to be sent.
buffer System.ByteBuffer The serialized buffer of the message. It is null, the message is serialized.
return void

SetCredit() public method

Sets a credit on the link. A flow is sent to the peer to update link flow control state.
public SetCredit ( int credit, bool drain, bool autoRestore = true ) : void
credit int The new link credit.
drain bool Sets the drain flag in the flow performative.
autoRestore bool If true, link credit is auto-restored when a message is accepted/rejected /// by the caller. If false, caller is responsible for manage link credits.
return void