This class is used to generate and deliver standard responses back to a client. More...
#include <ResponseCallback.h>
Public Member Functions | |
ResponseCallback (Comm *comm, EventPtr &event) | |
Constructor. More... | |
ResponseCallback () | |
Default constructor. More... | |
virtual | ~ResponseCallback () |
Destructor. More... | |
virtual int | error (int error, const String &msg) |
Sends a standard error response back to the client. More... | |
virtual int | response_ok () |
Sends a a simple success response back to the client which is just the 4-byte error code Error::OK. More... | |
void | get_address (struct sockaddr_in &addr) |
Gets the remote address of the requesting client. More... | |
const InetAddr | get_address () const |
Gets the remote address of the requesting client. More... | |
EventPtr & | event () |
Get smart pointer to event object that triggered the request. More... | |
Protected Attributes | |
Comm * | m_comm |
Comm pointer. More... | |
EventPtr | m_event |
Smart pointer to event object. More... | |
This class is used to generate and deliver standard responses back to a client.
Definition at line 46 of file ResponseCallback.h.
Constructor.
Initializes a pointer to the Comm object and saves a pointer to the event that triggered the request.
comm | Pointer to the Comm object |
event | Smart pointer to the event that generated the request |
Definition at line 56 of file ResponseCallback.h.
|
inline |
Default constructor.
Definition at line 61 of file ResponseCallback.h.
|
inlinevirtual |
Destructor.
Definition at line 64 of file ResponseCallback.h.
|
virtual |
Sends a standard error response back to the client.
The response message that is generated and sent back has the following format:
[int32] error code [int16] error message length [chars] error message
error | Error code |
msg | Error message |
Reimplemented in Hypertable::RangeServer::Response::Callback::PhantomUpdate.
Definition at line 42 of file ResponseCallback.cc.
|
inline |
Get smart pointer to event object that triggered the request.
Definition at line 103 of file ResponseCallback.h.
|
inline |
Gets the remote address of the requesting client.
addr | Reference to address structure to hold result |
Definition at line 89 of file ResponseCallback.h.
|
inline |
Gets the remote address of the requesting client.
Definition at line 96 of file ResponseCallback.h.
|
virtual |
Sends a a simple success response back to the client which is just the 4-byte error code Error::OK.
This can be used to signal success for all methods that don't have return values.
Reimplemented in Hypertable::RangeServer::Response::Callback::PhantomUpdate.
Definition at line 55 of file ResponseCallback.cc.
|
protected |
Comm pointer.
Definition at line 106 of file ResponseCallback.h.
|
protected |
Smart pointer to event object.
Definition at line 107 of file ResponseCallback.h.