Safir SDK Core
|
Class used for responding to received requests. More...
#include <Safir/Dob/ResponseSender.h>
Public Member Functions | |
virtual | ~ResponseSender () |
Destructor. More... | |
virtual void | Send (const Safir::Dob::ResponsePtr &response)=0 |
Sends a response for the request that this instance was obtained with. More... | |
virtual bool | IsDone ()=0 |
Check if an instance is still waiting for a response to be sent. More... | |
virtual void | Discard ()=0 |
Discard this ResponseSender. More... | |
Class used for responding to received requests.
The purpose of this class is to allow responses to be sent either from within the request callback, or at a later time (in which case you have to keep the responseSender you received in the callback "for later").
Note that you still have to send the response within the timout period, or the response will not be delivered to the requestor (who will have received a timeout response instead).
|
virtual |
Destructor.
Will check that the ResponseSender has been used, and if it hasn't an error will be reported (a PanicLog!).
Not using a ResponseSender is considered a programming error.
|
pure virtual |
Discard this ResponseSender.
Calling this function means that you forfeit your chance to send a response to the request. It will disable the checks in the destructor (see above).
The typical case when you must discard the ResponseSender is when calling Postpone with redispatchCurrent set to True. In this case you will get the request again together with a new ResponseSender.
|
pure virtual |
Check if an instance is still waiting for a response to be sent.
|
pure virtual |
Sends a response for the request that this instance was obtained with.
This method may only be called once on any given instance! Calling it twice amounts to trying to send two responses to one request, which is considered a programming error.
response | - The response to be sent. |
Safir::Dob::NotOpenException | - If the connection is not open. |