messaging_handler Class Reference

A handler for Proton messaging events. More...

#include <messaging_handler.hpp>

List of all members.

Public Member Functions

virtual void on_container_start (container &c)
 The container event loop is starting.
virtual void on_container_stop (container &c)
 The container event loop is stopping.
virtual void on_message (delivery &d, message &m)
 A message is received.
virtual void on_sendable (sender &s)
 A message can be sent.
virtual void on_transport_open (transport &t)
 The underlying network transport is open.
virtual void on_transport_close (transport &t)
 The underlying network transport has closed.
virtual void on_transport_error (transport &t)
 The underlying network transport has closed with an error condition.
virtual void on_connection_open (connection &c)
 The remote peer opened the connection.
virtual void on_connection_close (connection &c)
 The remote peer closed the connection.
virtual void on_connection_error (connection &c)
 The remote peer closed the connection with an error condition.
virtual void on_session_open (session &s)
 The remote peer opened the session.
virtual void on_session_close (session &s)
 The remote peer closed the session.
virtual void on_session_error (session &s)
 The remote peer closed the session with an error condition.
virtual void on_receiver_open (receiver &l)
 The remote peer opened the link.
virtual void on_receiver_detach (receiver &l)
 The remote peer detached the link.
virtual void on_receiver_close (receiver &l)
 The remote peer closed the link.
virtual void on_receiver_error (receiver &l)
 The remote peer closed the link with an error condition.
virtual void on_sender_open (sender &l)
 The remote peer opened the link.
virtual void on_sender_detach (sender &l)
 The remote peer detached the link.
virtual void on_sender_close (sender &l)
 The remote peer closed the link.
virtual void on_sender_error (sender &l)
 The remote peer closed the link with an error condition.
virtual void on_tracker_accept (tracker &d)
 The receiving peer accepted a transfer.
virtual void on_tracker_reject (tracker &d)
 The receiving peer rejected a transfer.
virtual void on_tracker_release (tracker &d)
 The receiving peer released a transfer.
virtual void on_tracker_settle (tracker &d)
 The receiving peer settled a transfer.
virtual void on_delivery_settle (delivery &d)
 The sending peer settled a transfer.
virtual void on_sender_drain_start (sender &s)
 **Experimental** - The receiving peer has requested a drain of remaining credit.
virtual void on_receiver_drain_finish (receiver &r)
 **Experimental** - The credit outstanding at the time of the call to receiver::drain has been consumed or returned.
virtual void on_error (const error_condition &c)
 Fallback error handling.

Detailed Description

A handler for Proton messaging events.

Subclass and override the event-handling member functions.

#### Close and error handling

There are several objects that have `on_X_close` and `on_X_error` functions. They are called as follows:

By default, if you do not implement `on_X_error`, it will call `on_error`. If you do not implement `on_error` it will throw a proton::error exception, which may not be what you want but does help to identify forgotten error handling quickly.

#### Resource cleanup

Every `on_X_open` event is paired with an `on_X_close` event which can clean up any resources created by the open handler. In particular this is still true if an error is reported with an `on_X_error` event. The error-handling logic doesn't have to manage resource clean up. It can assume that the close event will be along to handle it.


Member Function Documentation

virtual void on_container_start ( container c  )  [virtual]

The container event loop is starting.

This is the first event received after calling container::run

virtual void on_container_stop ( container c  )  [virtual]

The container event loop is stopping.

This is the last event received before the container event loop stops.

virtual void on_receiver_drain_finish ( receiver r  )  [virtual]

**Experimental** - The credit outstanding at the time of the call to receiver::drain has been consumed or returned.

virtual void on_sender_drain_start ( sender s  )  [virtual]

**Experimental** - The receiving peer has requested a drain of remaining credit.

virtual void on_transport_error ( transport t  )  [virtual]

The underlying network transport has closed with an error condition.


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

Generated on 13 Mar 2017 for Qpid Proton C++ by  doxygen 1.6.1