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

An HTTP/2 server that dispatches each request to an async handler. More...

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

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

Classes

struct  State
 

Public Member Functions

 ~Http2Server ()
 
absl::Status Stop ()
 Stops the server and releases its resources.
 
std::uint16_t port () const
 
std::string bind_address () const
 
bool running () const
 
bool secure () const
 
void *absl_nullable GetImpl () const
 

Static Public Member Functions

static absl::StatusOr< std::shared_ptr< Http2Server > > Create (std::string bind_address, std::uint16_t port, Http2RequestHandler handler, Http2Options options={})
 Creates and starts an HTTP/2 server.
 

Detailed Description

An HTTP/2 server that dispatches each request to an async handler.

The listening endpoint underlying the WebSocket and HTTP SSE server transports; also usable directly for plain HTTP/2 services.

Constructor & Destructor Documentation

◆ ~Http2Server()

a11::net::Http2Server::~Http2Server ( )

Member Function Documentation

◆ bind_address()

std::string a11::net::Http2Server::bind_address ( ) const
Returns
The address the server is bound to.

◆ Create()

absl::StatusOr< std::shared_ptr< Http2Server > > a11::net::Http2Server::Create ( std::string  bind_address,
std::uint16_t  port,
Http2RequestHandler  handler,
Http2Options  options = {} 
)
static

Creates and starts an HTTP/2 server.

Parameters
bind_addressLocal address to bind to.
portTCP port to listen on; 0 selects an ephemeral port.
handlerAsync callback invoked for each request.
optionsBody limits, buffering, deadline, and TLS settings.
Returns
The running server, or an error status.

◆ GetImpl()

void *absl_nullable a11::net::Http2Server::GetImpl ( ) const
Returns
An opaque native handle for advanced interop, or nullptr.

◆ port()

std::uint16_t a11::net::Http2Server::port ( ) const
Returns
The port listened on, resolved even for an ephemeral 0.

◆ running()

bool a11::net::Http2Server::running ( ) const
Returns
Whether the server is currently running.

◆ secure()

bool a11::net::Http2Server::secure ( ) const
Returns
Whether the server is using TLS.

◆ Stop()

absl::Status a11::net::Http2Server::Stop ( )

Stops the server and releases its resources.


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