Http connection abstraction holding both the incoming and outgoing messages in an HTTP transaction.
More...
#include <HttpConnection.h>
|
| void | reset () |
| | Prepare this client for re-use, marking it as Inactive.
|
| |
| ID | getConnectionID () const |
| | The ID used to find this client in HttpConnectionsPool.
|
| |
| void | markWebSocketUpgraded () |
| | Marks this HTTP connection as handed off to a WebSocket owner after a successful upgrade.
|
| |
| bool | isWebSocketUpgraded () const |
| | Returns true after the HTTP layer handed this connection to WebSocket code.
|
| |
| Result | sendBodyCopy (int httpCode, StringSpan body, StringSpan contentType={}) |
| | Sends a fixed-size response body by copying it into this connection's async buffer pool.
|
| |
| Result | sendTextCopy (int httpCode, StringSpan body) |
| | Sends a text/plain; charset=utf-8 response body by copying it into this connection's async buffer pool.
|
| |
| Result | sendJsonCopy (int httpCode, StringSpan body) |
| | Sends an application/json response body by copying it into this connection's async buffer pool.
|
| |
|
void | setHeaderMemory (Span< char > memory) |
| |
|
Span< char > | getHeaderMemory () const |
| |
|
void | setTransportStreams (AsyncReadableStream &readable, AsyncWritableStream &writable) |
| |
|
void | resetTransportStreams () |
| |
|
AsyncReadableStream & | getReadableTransportStream () |
| |
|
AsyncWritableStream & | getWritableTransportStream () |
| |
|
const AsyncReadableStream & | getReadableTransportStream () const |
| |
|
const AsyncWritableStream & | getWritableTransportStream () const |
| |
|
void | reset () |
| |
|
| enum class | State {
Inactive
,
Active
} |
| |
|
|
State | state = State::Inactive |
| |
|
ID | connectionID |
| |
|
bool | webSocketUpgraded = false |
| |
|
Span< char > | headerMemory |
| |
|
|
struct | HttpConnectionsPool |
| |
|
struct | HttpAsyncServer |
| |
Http connection abstraction holding both the incoming and outgoing messages in an HTTP transaction.
◆ getConnectionID()
| ID SC::HttpConnection::getConnectionID |
( |
| ) |
const |
|
inline |
◆ isWebSocketUpgraded()
| bool SC::HttpConnection::isWebSocketUpgraded |
( |
| ) |
const |
|
inlinenodiscard |
Returns true after the HTTP layer handed this connection to WebSocket code.
◆ markWebSocketUpgraded()
| void SC::HttpConnection::markWebSocketUpgraded |
( |
| ) |
|
|
inline |
Marks this HTTP connection as handed off to a WebSocket owner after a successful upgrade.
◆ reset()
| void SC::HttpConnection::reset |
( |
| ) |
|
Prepare this client for re-use, marking it as Inactive.
◆ sendBodyCopy()
| Result SC::HttpConnection::sendBodyCopy |
( |
int | httpCode, |
|
|
StringSpan | body, |
|
|
StringSpan | contentType = {} ) |
Sends a fixed-size response body by copying it into this connection's async buffer pool.
◆ sendJsonCopy()
| Result SC::HttpConnection::sendJsonCopy |
( |
int | httpCode, |
|
|
StringSpan | body ) |
Sends an application/json response body by copying it into this connection's async buffer pool.
◆ sendTextCopy()
| Result SC::HttpConnection::sendTextCopy |
( |
int | httpCode, |
|
|
StringSpan | body ) |
Sends a text/plain; charset=utf-8 response body by copying it into this connection's async buffer pool.
◆ requestCount
| uint32_t SC::HttpConnection::requestCount = 0 |
Number of requests processed on this connection.
The documentation for this struct was generated from the following file: