EHS Embedded HTTP Server
1.5.0.132
|
This class represents what is sent back to the client. More...
#include <ehstypes.h>
Public Member Functions | |
GenericResponse (int inResponseId, EHSConnection *ipoEHSConnection) | |
Constructs a new instance. | |
void | SetBody (const char *ipsBody, size_t inBodyLength) |
Sets the body of this instance. | |
std::string & | GetBody () |
retrieves the body of this response. | |
EHSConnection * | GetConnection () |
retrieves the EHSConnection, on which this response is supposed to be send. | |
virtual | ~GenericResponse () |
Destructor. | |
void | EnableIdleTimeout (bool enable=true) |
Enable/Disable idle-timeout handling for the current connection. | |
void | EnableKeepAlive (bool enable=true) |
Enable/Disable TCP keepalive on the underlying socket of the current connection. | |
Protected Attributes | |
int | m_nResponseId |
response id for making sure we send responses in the right order | |
std::string | m_sBody |
the actual body to be sent back | |
EHSConnection * | m_poEHSConnection |
ehs connection object this response goes back on | |
Friends | |
class | EHSConnection |
class | EHSServer |
This class represents what is sent back to the client.
It contains the actual body only. Any HTTP specific additions like headers or the response code are handled in the drived class HttpResponse.
GenericResponse | ( | int | inResponseId, |
EHSConnection * | ipoEHSConnection | ||
) | [inline] |
Constructs a new instance.
inResponseId | A unique Id (normally derived from the corresponding request Id). |
ipoEHSConnection | The connection, on which this response should be sent. |
Definition at line 97 of file ehstypes.h.
void EnableIdleTimeout | ( | bool | enable = true | ) |
Enable/Disable idle-timeout handling for the current connection.
enable | If true, idle-timeout handling is enabled, otherwise the socket may stay open forever. When creating an EHSConnection, this is initially enabled. |
void EnableKeepAlive | ( | bool | enable = true | ) |
Enable/Disable TCP keepalive on the underlying socket of the current connection.
This enables detection of "dead" sockets, even when idle-timeout handling is disabled.
enable | If true, enable TCP keepalive. When creating an EHSConnection, this is initially disabled. |
std::string& GetBody | ( | ) | [inline] |
retrieves the body of this response.
Definition at line 116 of file ehstypes.h.
References m_sBody.
EHSConnection* GetConnection | ( | ) | [inline] |
retrieves the EHSConnection, on which this response is supposed to be send.
Definition at line 123 of file ehstypes.h.
References m_poEHSConnection.
void SetBody | ( | const char * | ipsBody, |
size_t | inBodyLength | ||
) | [inline] |
Sets the body of this instance.
ipsBody | The content to set. |
inBodyLength | The length of the body. |
Reimplemented in HttpResponse.
Definition at line 108 of file ehstypes.h.
References m_sBody.