Qpid Proton C++ API  0.18.1
receiver

A channel for receiving messages. More...

#include <receiver.hpp>

Inheritance diagram for receiver:
link endpoint

Public Member Functions

 receiver ()
 Create an empty receiver.
 
void open ()
 Open the receiver. More...
 
void open (const receiver_options &opts)
 Open the receiver. More...
 
class source source () const
 Get the source node.
 
class target target () const
 Get the target node.
 
void add_credit (uint32_t)
 Increment the credit available to the sender. More...
 
void drain ()
 Unsettled API - Commence a drain cycle. More...
 
bool uninitialized () const
 True if the local end is uninitialized.
 
bool active () const
 True if the local end is active.
 
bool closed () const
 True if the local and remote ends are closed.
 
class error_condition error () const
 Get the error condition of the remote endpoint.
 
void close ()
 Close the endpoint. More...
 
void close (const error_condition &)
 Close the endpoint with an error condition. More...
 
void detach ()
 Suspend the link without closing it. More...
 
int credit () const
 Credit available on the link.
 
bool draining ()
 Unsettled API - True for a receiver if a drain cycle has been started and the corresponding on_receiver_drain_finish event is still pending. More...
 
std::string name () const
 Get the link name.
 
class containercontainer () const
 The container for this link.
 
class work_queuework_queue () const
 Get the work_queue for the link.
 
class connection connection () const
 The connection that owns this link.
 
class session session () const
 The session that owns this link.
 

Detailed Description

A channel for receiving messages.

Examples:
broker.cpp, client.cpp, multithreaded_client_flow_control.cpp, service_bus.cpp, and simple_recv.cpp.

Member Function Documentation

◆ open() [1/2]

void open ( )

Open the receiver.

See also
endpoint_lifecycle
Examples:
broker.cpp.

◆ open() [2/2]

void open ( const receiver_options opts)

Open the receiver.

See also
endpoint_lifecycle

◆ add_credit()

void add_credit ( uint32_t  )

Increment the credit available to the sender.

Credit granted during a drain cycle is not communicated to the receiver until the drain completes.

Examples:
multithreaded_client_flow_control.cpp.

◆ drain()

void drain ( )

Unsettled API - Commence a drain cycle.

If there is positive credit, a request is sent to the sender to immediately use up all of the existing credit balance by sending messages that are immediately available and releasing any unused credit (see sender::return_credit). Throws proton::error if a drain cycle is already in progress. An on_receiver_drain_finish event will be generated when the outstanding drained credit reaches zero.

◆ close() [1/2]

void close ( )
virtualinherited

Close the endpoint.

See also
endpoint_lifecycle

Implements endpoint.

Examples:
direct_recv.cpp, helloworld.cpp, helloworld_direct.cpp, service_bus.cpp, and simple_recv.cpp.

◆ close() [2/2]

void close ( const error_condition )
virtualinherited

Close the endpoint with an error condition.

See also
endpoint_lifecycle

Implements endpoint.

◆ detach()

void detach ( )
inherited

Suspend the link without closing it.

A suspended link may be reopened with the same or different link options if supported by the peer. A suspended durable subscription becomes inactive without cancelling it.

◆ draining()

bool draining ( )
inherited

Unsettled API - True for a receiver if a drain cycle has been started and the corresponding on_receiver_drain_finish event is still pending.

True for a sender if the receiver has requested a drain of credit and the sender has unused credit.

See also
receiver::drain.

The documentation for this class was generated from the following file: