Interface for classes which can handle incoming PDU's. More...
#include <connector.hpp>
Public Member Functions | |
| virtual void | handle_pdu (boost::shared_ptr< PDU > pdu, int error)=0 |
| Handler method for incoming PDU's. | |
| virtual | ~pdu_handler () |
| Destructor. | |
Interface for classes which can handle incoming PDU's.
Classes which want to receive incoming PDU's implement this interface. An object of type pdu_handler can then be registered with a connector object to indicate that it wants to receive PDU's.
Definition at line 143 of file connector.hpp.
| virtual agentxcpp::connector::pdu_handler::~pdu_handler | ( | ) | [inline, virtual] |
Destructor.
Definition at line 173 of file connector.hpp.
| virtual void agentxcpp::connector::pdu_handler::handle_pdu | ( | boost::shared_ptr< PDU > | pdu, |
| int | error | ||
| ) | [pure virtual] |
Handler method for incoming PDU's.
When a PDU is received by the connector class, this method is called on the registered object. Note that ResponsePDU's are not handed over to the registered object.
The 'error' parameter is used to report errors. Using exceptions is not possible because of the asynchronous nature of the callback-mechanism.
| pdu | The PDU which was just received. This is an empty shared_ptr if an error occured. |
| error | The error code. 0 means success, -1 means "parse error", -2 means "version error". |
Referenced by agentxcpp::connector::receive_callback().