A11 (C++ runtime)
Native C++ implementation of the A11 action and streaming runtime
Loading...
Searching...
No Matches
a11::net::Http2DuplexStream Class Reference

Client side of an HTTP/2 extended CONNECT stream. More...

#include <cpp/a11/net/http2.h>

Inheritance diagram for a11::net::Http2DuplexStream:
[legend]

Public Member Functions

a11::Future< HttpResponseHeadHeaders () const
 
a11::Future< std::optional< std::string > > Read ()
 
absl::Status Write (std::string data)
 Writes a chunk of request DATA.
 
absl::Status Finish ()
 Closes the request side, signalling END_STREAM to the peer.
 
absl::Status Abort (absl::Status status=absl::CancelledError("HTTP/2 duplex stream cancelled"))
 Aborts the whole duplex stream with the given status.
 
a11::Task Done () const
 
std::int32_t stream_id () const
 

Friends

class Http2Connection
 
class Http2Client
 

Detailed Description

Client side of an HTTP/2 extended CONNECT stream.

Request DATA remains writable via Write()/Finish() while response DATA is read independently with Read() on the same stream. This bidirectional primitive is what the WebSocket transport is built on.

Member Function Documentation

◆ Abort()

absl::Status a11::net::Http2DuplexStream::Abort ( absl::Status  status = absl::CancelledError(                         "HTTP/2 duplex stream cancelled"))

Aborts the whole duplex stream with the given status.

◆ Done()

a11::Task a11::net::Http2DuplexStream::Done ( ) const
Returns
An awaitable that resolves when the duplex stream is done.

◆ Finish()

absl::Status a11::net::Http2DuplexStream::Finish ( )

Closes the request side, signalling END_STREAM to the peer.

◆ Headers()

a11::Future< HttpResponseHead > a11::net::Http2DuplexStream::Headers ( ) const
Returns
An awaitable resolving to the response status and headers.

◆ Read()

a11::Future< std::optional< std::string > > a11::net::Http2DuplexStream::Read ( )
Returns
An awaitable resolving to the next inbound chunk, or nullopt at end of stream.

◆ stream_id()

std::int32_t a11::net::Http2DuplexStream::stream_id ( ) const
Returns
The HTTP/2 stream identifier.

◆ Write()

absl::Status a11::net::Http2DuplexStream::Write ( std::string  data)

Writes a chunk of request DATA.

Friends And Related Symbol Documentation

◆ Http2Client

◆ Http2Connection


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