|
Symbian platform (C++)
SDK native APIs, runtime and tooling
|
Worker-owned HTTP exchange with pull bodies and a response writer. More...
#include <cpp/symbian/http/connection.h>
Public Member Functions | |
| ~Connection () | |
| const RequestHead & | request () const |
| const ResponseHead & | response () const |
| const Headers & | trailers () const |
| absl::Status | ReceiveHeaders (absl::Time deadline) |
| absl::StatusOr< std::optional< std::string > > | Read (absl::Time deadline) |
| absl::Status | SendHeaders (ResponseHead head, absl::Time deadline, std::optional< std::size_t > body_length=std::nullopt) |
| absl::Status | Write (std::string_view bytes, absl::Time deadline) |
| absl::Status | Finish (absl::Time deadline) |
| void | Abort () |
Static Public Member Functions | |
| static absl::StatusOr< std::unique_ptr< Connection > > | Client (std::unique_ptr< net::ByteStream > transport, RequestHead request, Protocol protocol=Protocol::kHttp11, Limits limits={}, std::optional< std::size_t > body_length=0, absl::Time deadline=absl::InfiniteFuture()) |
| static absl::StatusOr< std::unique_ptr< Connection > > | Accept (std::unique_ptr< net::ByteStream > transport, Protocol protocol=Protocol::kHttp11, Limits limits={}, absl::Time deadline=absl::InfiniteFuture()) |
Worker-owned HTTP exchange with pull bodies and a response writer.
Client sends request headers; Write/Finish send its body. ReceiveHeaders waits for the final response head. Accept waits only for a request head; Read pulls the request body before or while sending a response. On either side Read returns nullopt only at clean end, and errors on truncation. SendHeaders/Write/Finish form the server response writer. An optional length selects fixed framing; nullopt streams chunked HTTP/1.1 or HTTP/2 DATA. Write accepts at most 32 KiB, limiting memory while transport applies backpressure. The caller selects the protocol (TLS must negotiate it).
One exchange per connection; no reuse, redirect, decompression, multiplexing or hidden task/thread. Use the SDK worker executor for background execution. Destruction cancels by closing the owned transport. Abort is terminal.
| symbian::http::Connection::~Connection | ( | ) |
| void symbian::http::Connection::Abort | ( | ) |
|
static |
|
static |
| absl::Status symbian::http::Connection::Finish | ( | absl::Time | deadline | ) |
| absl::StatusOr< std::optional< std::string > > symbian::http::Connection::Read | ( | absl::Time | deadline | ) |
| absl::Status symbian::http::Connection::ReceiveHeaders | ( | absl::Time | deadline | ) |
|
inline |
|
inline |
| absl::Status symbian::http::Connection::SendHeaders | ( | ResponseHead | head, |
| absl::Time | deadline, | ||
| std::optional< std::size_t > | body_length = std::nullopt |
||
| ) |
|
inline |
| absl::Status symbian::http::Connection::Write | ( | std::string_view | bytes, |
| absl::Time | deadline | ||
| ) |