ServerResponder
#include <icy/http/server.h>
class ServerResponderDefined in src/http/include/icy/http/server.h:146
Base responder interface for handling one HTTP request on a server connection. Derived classes typically override onRequest() and optionally the streaming hooks.
Public Methods
| Return | Name | Description |
|---|---|---|
ServerResponder inline | Creates a ServerResponder for the given connection. | |
~ServerResponder virtual | Defaulted destructor. | |
void | onHeaders virtual inline | Called when the incoming request headers have been parsed. |
void | onPayload virtual inline | Called for each chunk of incoming request body data. |
void | onRequest virtual inline | Called when the complete HTTP request has been received. Derived classes should write their response here. |
void | onClose virtual inline | Called when the connection is closed. |
ServerConnection & | connection inline | Returns the underlying server connection. |
Request & | request inline | Returns the current HTTP request from the underlying connection. |
Response & | response inline | Returns the current HTTP response from the underlying connection. |
ServerResponder
inline
inline ServerResponder(ServerConnection & connection)Defined in src/http/include/icy/http/server.h:151
Creates a ServerResponder for the given connection.
Parameters
| Parameter | Type | Description |
|---|---|---|
connection | ServerConnection & | The server connection this responder handles. |
~ServerResponder
virtual
virtual ~ServerResponder() = defaultDefined in src/http/include/icy/http/server.h:156
Defaulted destructor.
onHeaders
virtual inline
virtual inline void onHeaders(Request & request)Defined in src/http/include/icy/http/server.h:160
Called when the incoming request headers have been parsed.
Parameters
| Parameter | Type | Description |
|---|---|---|
request | Request & | The parsed HTTP request with headers populated. |
onPayload
virtual inline
virtual inline void onPayload(const MutableBuffer & body)Defined in src/http/include/icy/http/server.h:164
Called for each chunk of incoming request body data.
Parameters
| Parameter | Type | Description |
|---|---|---|
body | const MutableBuffer & | Buffer containing a chunk of the request body. |
onRequest
virtual inline
virtual inline void onRequest(Request & request, Response & response)Defined in src/http/include/icy/http/server.h:170
Called when the complete HTTP request has been received. Derived classes should write their response here.
Parameters
| Parameter | Type | Description |
|---|---|---|
request | Request & | The fully received HTTP request. |
response | Response & | The HTTP response to populate and send. |
onClose
virtual inline
virtual inline void onClose()Defined in src/http/include/icy/http/server.h:177
Called when the connection is closed.
connection
inline
inline ServerConnection & connection()Defined in src/http/include/icy/http/server.h:180
Returns the underlying server connection.
request
inline
inline Request & request()Defined in src/http/include/icy/http/server.h:186
Returns the current HTTP request from the underlying connection.
response
inline
inline Response & response()Defined in src/http/include/icy/http/server.h:192
Returns the current HTTP response from the underlying connection.
Protected Attributes
| Return | Name | Description |
|---|---|---|
ServerConnection & | _connection |
_connection
ServerConnection & _connectionType: ServerConnection &
Defined in src/http/include/icy/http/server.h:198
Private Methods
| Return | Name | Description |
|---|---|---|
ServerResponder | Deleted constructor. | |
ServerResponder & | operator= | Deleted assignment operator. |
ServerResponder
ServerResponder(const ServerResponder &) = deleteDefined in src/http/include/icy/http/server.h:201
Deleted constructor.
operator=
ServerResponder & operator=(const ServerResponder &) = deleteDefined in src/http/include/icy/http/server.h:202
Deleted assignment operator.
