C# Class Amqp.ReceiverLink

The ReceiverLink class represents a link that accepts incoming messages.
Inheritance: Link
显示文件 Open project: xamarin/mini-hacks Class Usage Examples

Public Methods

Method Description
Accept ( Amqp.Message message ) : void

Accepts a message. It sends an accepted outcome to the peer.

Receive ( int timeout = 60000 ) : Amqp.Message

Receives a message. The call is blocked for the timeout in seconds or a message is available.

ReceiverLink ( Session session, string name, Amqp.Framing.Attach attach, OnAttached onAttached ) : System.Threading

Initializes a receiver link.

ReceiverLink ( Session session, string name, Amqp.Framing.Source source, OnAttached onAttached ) : System.Threading

Initializes a receiver link.

ReceiverLink ( Session session, string name, string adderss ) : System.Threading

Initializes a receiver link.

Reject ( Amqp.Message message, Amqp.Framing.Error error = null ) : void

Rejects a message. It sends a rejected outcome to the peer.

Release ( Amqp.Message message ) : void

Releases a message. It sends a released outcome to the peer.

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

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

Start ( int credit, MessageCallback onMessage = null ) : void

Starts the message pump.

Protected Methods

Method Description
OnAbort ( Amqp.Framing.Error error ) : void

Aborts the receiver link.

OnClose ( Amqp.Framing.Error error ) : bool

Closes the receiver link.

Private Methods

Method Description
DisposeMessage ( Amqp.Message message, Amqp.Framing.Outcome outcome ) : void
OnAttach ( uint remoteHandle, Amqp.Framing.Attach attach ) : void
OnDeliverMessage ( ) : void
OnDelivery ( Amqp.SequenceNumber deliveryId ) : void
OnDeliveryStateChanged ( Amqp.Delivery delivery ) : void
OnFlow ( Amqp.Framing.Flow flow ) : void
OnTransfer ( Amqp.Delivery delivery, Amqp.Framing.Transfer transfer, ByteBuffer buffer ) : void
ReceiveInternal ( MessageCallback callback, int timeout = 60000 ) : Amqp.Message

Method Details

Accept() public method

Accepts a message. It sends an accepted outcome to the peer.
public Accept ( Amqp.Message message ) : void
message Amqp.Message The message to accept.
return void

OnAbort() protected method

Aborts the receiver link.
protected OnAbort ( Amqp.Framing.Error error ) : void
error Amqp.Framing.Error The error for the abort.
return void

OnClose() protected method

Closes the receiver link.
protected OnClose ( Amqp.Framing.Error error ) : bool
error Amqp.Framing.Error The error for the closure.
return bool

Receive() public method

Receives a message. The call is blocked for the timeout in seconds or a message is available.
public Receive ( int timeout = 60000 ) : Amqp.Message
timeout int Number of seconds to wait.
return Amqp.Message

ReceiverLink() public method

Initializes a receiver link.
public ReceiverLink ( Session session, string name, Amqp.Framing.Attach attach, OnAttached onAttached ) : System.Threading
session Session The session within which to create the link.
name string The link name.
attach Amqp.Framing.Attach The attach frame to send for this link.
onAttached OnAttached The callback to invoke when an attach is received from peer.
return System.Threading

ReceiverLink() public method

Initializes a receiver link.
public ReceiverLink ( Session session, string name, Amqp.Framing.Source source, OnAttached onAttached ) : System.Threading
session Session The session within which to create the link.
name string The link name.
source Amqp.Framing.Source The source on attach that specifies the message source.
onAttached OnAttached The callback to invoke when an attach is received from peer.
return System.Threading

ReceiverLink() public method

Initializes a receiver link.
public ReceiverLink ( Session session, string name, string adderss ) : System.Threading
session Session The session within which to create the link.
name string The link name.
adderss string The node address.
return System.Threading

Reject() public method

Rejects a message. It sends a rejected outcome to the peer.
public Reject ( Amqp.Message message, Amqp.Framing.Error error = null ) : void
message Amqp.Message The message to reject.
error Amqp.Framing.Error The error, if any, for the rejection.
return void

Release() public method

Releases a message. It sends a released outcome to the peer.
public Release ( Amqp.Message message ) : void
message Amqp.Message The message to release.
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 autoRestore = true ) : void
credit int The new link credit.
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

Start() public method

Starts the message pump.
public Start ( int credit, MessageCallback onMessage = null ) : void
credit int The link credit to issue.
onMessage MessageCallback If specified, the callback to invoke when messages are received. If not specified, call Receive method to get the messages.
return void