Symbian platform (C++)
SDK native APIs, runtime and tooling
Loading...
Searching...
No Matches
symbian::http::Connection Class Reference

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())
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~Connection()

symbian::http::Connection::~Connection ( )

Member Function Documentation

◆ Abort()

void symbian::http::Connection::Abort ( )

◆ Accept()

absl::StatusOr< std::unique_ptr< Connection > > symbian::http::Connection::Accept ( std::unique_ptr< net::ByteStream >  transport,
Protocol  protocol = Protocol::kHttp11,
Limits  limits = {},
absl::Time  deadline = absl::InfiniteFuture() 
)
static

◆ Client()

absl::StatusOr< std::unique_ptr< Connection > > symbian::http::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

◆ Finish()

absl::Status symbian::http::Connection::Finish ( absl::Time  deadline)

◆ Read()

absl::StatusOr< std::optional< std::string > > symbian::http::Connection::Read ( absl::Time  deadline)

◆ ReceiveHeaders()

absl::Status symbian::http::Connection::ReceiveHeaders ( absl::Time  deadline)

◆ request()

const RequestHead & symbian::http::Connection::request ( ) const
inline

◆ response()

const ResponseHead & symbian::http::Connection::response ( ) const
inline

◆ SendHeaders()

absl::Status symbian::http::Connection::SendHeaders ( ResponseHead  head,
absl::Time  deadline,
std::optional< std::size_t >  body_length = std::nullopt 
)

◆ trailers()

const Headers & symbian::http::Connection::trailers ( ) const
inline

◆ Write()

absl::Status symbian::http::Connection::Write ( std::string_view  bytes,
absl::Time  deadline 
)

The documentation for this class was generated from the following files: