Network System 0.1.1
High-performance modular networking library for scalable client-server applications
Loading...
Searching...
No Matches
kcenon::network::protocols::http2::http2_server Class Reference

HTTP/2 server with TLS support. More...

#include <http2_server.h>

Inheritance diagram for kcenon::network::protocols::http2::http2_server:
Inheritance graph
Collaboration diagram for kcenon::network::protocols::http2::http2_server:
Collaboration graph

Public Types

using request_handler_t
 Request handler function type.
 
using error_handler_t
 Error handler function type.
 

Public Member Functions

 http2_server (std::string_view server_id)
 Construct HTTP/2 server.
 
 ~http2_server ()
 Destructor - stops server gracefully.
 
 http2_server (const http2_server &)=delete
 
http2_server & operator= (const http2_server &)=delete
 
 http2_server (http2_server &&)=delete
 
http2_server & operator= (http2_server &&)=delete
 
auto start (unsigned short port) -> VoidResult
 Start HTTP/2 server without TLS (h2c - HTTP/2 cleartext)
 
auto start_tls (unsigned short port, const tls_config &config) -> VoidResult
 Start HTTP/2 server with TLS.
 
auto stop () -> VoidResult
 Stop the server.
 
auto is_running () const -> bool
 Check if server is running.
 
auto wait () -> void
 Wait for server to stop.
 
auto set_request_handler (request_handler_t handler) -> void
 Set request handler.
 
auto set_error_handler (error_handler_t handler) -> void
 Set error handler.
 
auto set_settings (const http2_settings &settings) -> void
 Set server settings.
 
auto get_settings () const -> http2_settings
 Get current settings.
 
auto active_connections () const -> size_t
 Get number of active connections.
 
auto active_streams () const -> size_t
 Get total number of active streams across all connections.
 
auto server_id () const -> std::string_view
 Get server identifier.
 

Private Member Functions

auto do_accept () -> void
 
auto do_accept_tls () -> void
 
auto handle_accept (std::error_code ec, asio::ip::tcp::socket socket) -> void
 
auto handle_accept_tls (std::error_code ec, asio::ip::tcp::socket socket) -> void
 
auto add_connection (std::shared_ptr< http2_server_connection > conn) -> void
 
auto remove_connection (uint64_t connection_id) -> void
 
auto cleanup_dead_connections () -> void
 
auto start_cleanup_timer () -> void
 
auto run_io () -> void
 
auto stop_io () -> void
 

Private Attributes

std::string server_id_
 Server identifier.
 
std::unique_ptr< asio::io_context > io_context_
 
std::unique_ptr< asio::ssl::context > ssl_context_
 
std::unique_ptr< asio::ip::tcp::acceptor > acceptor_
 
std::unique_ptr< asio::executor_work_guard< asio::io_context::executor_type > > work_guard_
 
std::future< void > io_future_
 
std::atomic< bool > is_running_ {false}
 
std::atomic< bool > use_tls_ {false}
 
std::promise< void > stop_promise_
 
std::future< void > stop_future_
 
request_handler_t request_handler_
 
error_handler_t error_handler_
 
std::mutex connections_mutex_
 
std::map< uint64_t, std::shared_ptr< http2_server_connection > > connections_
 
std::atomic< uint64_t > next_connection_id_ {1}
 
std::mutex settings_mutex_
 
http2_settings settings_
 
std::shared_ptr< hpack_encoder > encoder_
 
std::shared_ptr< hpack_decoder > decoder_
 
std::unique_ptr< asio::steady_timer > cleanup_timer_
 

Static Private Attributes

static constexpr std::string_view CONNECTION_PREFACE
 
static constexpr size_t FRAME_HEADER_SIZE = 9
 

Detailed Description

HTTP/2 server with TLS support.

Thread Safety

  • All public methods are thread-safe
  • Request handler is called from I/O thread
  • Multiple connections handled concurrently

Features

  • HTTP/2 protocol support (RFC 7540)
  • HPACK header compression (RFC 7541)
  • TLS 1.3 with ALPN "h2" negotiation
  • Stream multiplexing
  • Flow control
  • Connection-level and stream-level flow control

Usage Example

auto server = std::make_shared<http2_server>("my-server");
server->set_request_handler([](http2_server_stream& stream,
const http2_request& request) {
if (request.method == "GET" && request.path == "/api/health") {
stream.send_headers(200, {{"content-type", "application/json"}});
stream.send_data(R"({"status": "ok"})", true);
} else {
stream.send_headers(404, {});
stream.send_data("Not Found", true);
}
});
// Start with TLS
tls_config config;
config.cert_file = "/path/to/cert.pem";
config.key_file = "/path/to/key.pem";
server->start_tls(8443, config);
// Wait for shutdown signal
server->wait();
// Stop server
server->stop();
Server-side HTTP/2 stream for sending responses.
auto send_headers(int status_code, const std::vector< http_header > &headers, bool end_stream=false) -> VoidResult
Send response headers.
auto send_data(const std::vector< uint8_t > &data, bool end_stream=false) -> VoidResult
Send response data.
tracing_config config
Definition exporters.cpp:29
@ server
Server-side handling of a request.
std::string path
Request path (:path pseudo-header)
std::string method
HTTP method (:method pseudo-header)

Definition at line 99 of file http2_server.h.

Member Typedef Documentation

◆ error_handler_t

Initial value:
std::function<void(
const std::string& error_message)>

Error handler function type.

Definition at line 108 of file http2_server.h.

◆ request_handler_t

Initial value:
std::function<void(
http2_server_stream& stream,
const http2_request& request)>

Request handler function type.

Definition at line 103 of file http2_server.h.

Constructor & Destructor Documentation

◆ http2_server() [1/3]

kcenon::network::protocols::http2::http2_server::http2_server ( std::string_view server_id)
explicit

Construct HTTP/2 server.

Parameters
server_idUnique server identifier for logging

Definition at line 16 of file http2_server.cpp.

18 , stop_future_(stop_promise_.get_future())
19 , encoder_(std::make_shared<hpack_encoder>(settings_.header_table_size))
20 , decoder_(std::make_shared<hpack_decoder>(settings_.header_table_size))
21 {
22 }
auto server_id() const -> std::string_view
Get server identifier.
std::shared_ptr< hpack_encoder > encoder_
std::shared_ptr< hpack_decoder > decoder_
uint32_t header_table_size
HPACK dynamic table size.

◆ ~http2_server()

kcenon::network::protocols::http2::http2_server::~http2_server ( )

Destructor - stops server gracefully.

Definition at line 24 of file http2_server.cpp.

25 {
26 if (is_running_) {
27 stop();
28 }
29 }
auto stop() -> VoidResult
Stop the server.

References is_running_, and stop().

Here is the call graph for this function:

◆ http2_server() [2/3]

kcenon::network::protocols::http2::http2_server::http2_server ( const http2_server & )
delete

◆ http2_server() [3/3]

kcenon::network::protocols::http2::http2_server::http2_server ( http2_server && )
delete

Member Function Documentation

◆ active_connections()

auto kcenon::network::protocols::http2::http2_server::active_connections ( ) const -> size_t
nodiscard

Get number of active connections.

Returns
Active connection count

Definition at line 243 of file http2_server.cpp.

244 {
245 std::lock_guard<std::mutex> lock(const_cast<std::mutex&>(connections_mutex_));
246 return connections_.size();
247 }
std::map< uint64_t, std::shared_ptr< http2_server_connection > > connections_

◆ active_streams()

auto kcenon::network::protocols::http2::http2_server::active_streams ( ) const -> size_t
nodiscard

Get total number of active streams across all connections.

Returns
Active stream count

Definition at line 249 of file http2_server.cpp.

250 {
251 std::lock_guard<std::mutex> lock(const_cast<std::mutex&>(connections_mutex_));
252 size_t total = 0;
253 for (const auto& [id, conn] : connections_) {
254 total += conn->stream_count();
255 }
256 return total;
257 }

◆ add_connection()

auto kcenon::network::protocols::http2::http2_server::add_connection ( std::shared_ptr< http2_server_connection > conn) -> void
private

Definition at line 358 of file http2_server.cpp.

359 {
360 std::lock_guard<std::mutex> lock(connections_mutex_);
361 connections_[conn->connection_id()] = std::move(conn);
362 }

◆ cleanup_dead_connections()

auto kcenon::network::protocols::http2::http2_server::cleanup_dead_connections ( ) -> void
private

Definition at line 370 of file http2_server.cpp.

371 {
372 std::lock_guard<std::mutex> lock(connections_mutex_);
373 for (auto it = connections_.begin(); it != connections_.end();) {
374 if (!it->second->is_alive()) {
375 it = connections_.erase(it);
376 } else {
377 ++it;
378 }
379 }
380 }

◆ do_accept()

auto kcenon::network::protocols::http2::http2_server::do_accept ( ) -> void
private

Definition at line 264 of file http2_server.cpp.

265 {
266 if (!is_running_ || !acceptor_) {
267 return;
268 }
269
270 acceptor_->async_accept(
271 [this](std::error_code ec, asio::ip::tcp::socket socket) {
272 handle_accept(ec, std::move(socket));
273 });
274 }
auto handle_accept(std::error_code ec, asio::ip::tcp::socket socket) -> void
std::unique_ptr< asio::ip::tcp::acceptor > acceptor_

◆ do_accept_tls()

auto kcenon::network::protocols::http2::http2_server::do_accept_tls ( ) -> void
private

Definition at line 276 of file http2_server.cpp.

277 {
278 if (!is_running_ || !acceptor_) {
279 return;
280 }
281
282 acceptor_->async_accept(
283 [this](std::error_code ec, asio::ip::tcp::socket socket) {
284 handle_accept_tls(ec, std::move(socket));
285 });
286 }
auto handle_accept_tls(std::error_code ec, asio::ip::tcp::socket socket) -> void

◆ get_settings()

auto kcenon::network::protocols::http2::http2_server::get_settings ( ) const -> http2_settings
nodiscard

Get current settings.

Returns
Current HTTP/2 settings

Definition at line 237 of file http2_server.cpp.

238 {
239 std::lock_guard<std::mutex> lock(settings_mutex_);
240 return settings_;
241 }

◆ handle_accept()

auto kcenon::network::protocols::http2::http2_server::handle_accept ( std::error_code ec,
asio::ip::tcp::socket socket ) -> void
private

Definition at line 288 of file http2_server.cpp.

289 {
290 if (!is_running_) {
291 return;
292 }
293
294 if (ec) {
295 if (error_handler_) {
296 error_handler_(std::string("Accept error: ") + ec.message());
297 }
298 } else {
299 uint64_t conn_id = next_connection_id_++;
300 auto conn = std::make_shared<http2_server_connection>(
301 conn_id,
302 std::move(socket),
303 get_settings(),
306
307 add_connection(conn);
308 conn->start();
309 }
310
311 // Continue accepting
312 do_accept();
313 }
auto get_settings() const -> http2_settings
Get current settings.
auto add_connection(std::shared_ptr< http2_server_connection > conn) -> void

◆ handle_accept_tls()

auto kcenon::network::protocols::http2::http2_server::handle_accept_tls ( std::error_code ec,
asio::ip::tcp::socket socket ) -> void
private

Definition at line 315 of file http2_server.cpp.

316 {
317 if (!is_running_) {
318 return;
319 }
320
321 if (ec) {
322 if (error_handler_) {
323 error_handler_(std::string("Accept error: ") + ec.message());
324 }
326 return;
327 }
328
329 auto tls_socket = std::make_unique<asio::ssl::stream<asio::ip::tcp::socket>>(
330 std::move(socket), *ssl_context_);
331
332 auto* raw_socket = tls_socket.get();
333 raw_socket->async_handshake(
334 asio::ssl::stream_base::server,
335 [this, tls_socket = std::move(tls_socket)](std::error_code ec) mutable {
336 if (ec) {
337 if (error_handler_) {
338 error_handler_(std::string("TLS handshake error: ") + ec.message());
339 }
340 } else {
341 uint64_t conn_id = next_connection_id_++;
342 auto conn = std::make_shared<http2_server_connection>(
343 conn_id,
344 std::move(tls_socket),
345 get_settings(),
348
349 add_connection(conn);
350 conn->start();
351 }
352
353 // Continue accepting
355 });
356 }
std::unique_ptr< asio::ssl::context > ssl_context_

◆ is_running()

auto kcenon::network::protocols::http2::http2_server::is_running ( ) const -> bool
nodiscard

Check if server is running.

Returns
True if server is accepting connections

Definition at line 209 of file http2_server.cpp.

210 {
211 return is_running_;
212 }

◆ operator=() [1/2]

http2_server & kcenon::network::protocols::http2::http2_server::operator= ( const http2_server & )
delete

◆ operator=() [2/2]

http2_server & kcenon::network::protocols::http2::http2_server::operator= ( http2_server && )
delete

◆ remove_connection()

auto kcenon::network::protocols::http2::http2_server::remove_connection ( uint64_t connection_id) -> void
private

Definition at line 364 of file http2_server.cpp.

365 {
366 std::lock_guard<std::mutex> lock(connections_mutex_);
367 connections_.erase(connection_id);
368 }

◆ run_io()

auto kcenon::network::protocols::http2::http2_server::run_io ( ) -> void
private

Definition at line 398 of file http2_server.cpp.

399 {
400 if (io_context_) {
401 io_context_->run();
402 }
403 }
std::unique_ptr< asio::io_context > io_context_

◆ server_id()

auto kcenon::network::protocols::http2::http2_server::server_id ( ) const -> std::string_view
nodiscard

Get server identifier.

Returns
Server ID string

Definition at line 259 of file http2_server.cpp.

260 {
261 return server_id_;
262 }

◆ set_error_handler()

auto kcenon::network::protocols::http2::http2_server::set_error_handler ( error_handler_t handler) -> void

Set error handler.

Parameters
handlerFunction to handle errors

Definition at line 224 of file http2_server.cpp.

225 {
226 error_handler_ = std::move(handler);
227 }

◆ set_request_handler()

auto kcenon::network::protocols::http2::http2_server::set_request_handler ( request_handler_t handler) -> void

Set request handler.

Parameters
handlerFunction to handle incoming requests

The handler is called for each complete HTTP/2 request. Handler should not block for long periods.

Definition at line 219 of file http2_server.cpp.

220 {
221 request_handler_ = std::move(handler);
222 }

◆ set_settings()

auto kcenon::network::protocols::http2::http2_server::set_settings ( const http2_settings & settings) -> void

Set server settings.

Parameters
settingsHTTP/2 settings to use

Definition at line 229 of file http2_server.cpp.

230 {
231 std::lock_guard<std::mutex> lock(settings_mutex_);
233 encoder_->set_max_table_size(settings.header_table_size);
234 decoder_->set_max_table_size(settings.header_table_size);
235 }

References kcenon::network::protocols::http2::settings.

◆ start()

auto kcenon::network::protocols::http2::http2_server::start ( unsigned short port) -> VoidResult

Start HTTP/2 server without TLS (h2c - HTTP/2 cleartext)

Parameters
portPort to listen on
Returns
Success or error
Note
h2c is not widely supported. Prefer start_tls() for production.

Definition at line 31 of file http2_server.cpp.

32 {
33 if (is_running_) {
34 return error_void(
36 "Server already running",
37 "http2_server");
38 }
39
40 try {
41 stop_io();
42 cleanup_timer_.reset();
43 acceptor_.reset();
44 ssl_context_.reset();
45 io_context_ = std::make_unique<asio::io_context>();
46 work_guard_ = std::make_unique<asio::executor_work_guard<asio::io_context::executor_type>>(
47 io_context_->get_executor());
48
49 acceptor_ = std::make_unique<asio::ip::tcp::acceptor>(
51 asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port));
52
53 use_tls_ = false;
54 is_running_ = true;
55
56 // Start I/O thread
57 io_future_ = std::async(std::launch::async, [this]() { run_io(); });
58
59 // Start accepting connections
60 do_accept();
62
63 return ok();
64 } catch (const std::exception& e) {
65 return error_void(
67 std::string("Failed to start server: ") + e.what(),
68 "http2_server");
69 }
70 }
std::unique_ptr< asio::steady_timer > cleanup_timer_
std::unique_ptr< asio::executor_work_guard< asio::io_context::executor_type > > work_guard_
VoidResult error_void(int code, const std::string &message, const std::string &source="network_system", const std::string &details="")
VoidResult ok()

References kcenon::network::error_codes::common_errors::already_exists, kcenon::network::error_codes::network_system::bind_failed, kcenon::network::error_void(), and kcenon::network::ok().

Here is the call graph for this function:

◆ start_cleanup_timer()

auto kcenon::network::protocols::http2::http2_server::start_cleanup_timer ( ) -> void
private

Definition at line 382 of file http2_server.cpp.

383 {
384 if (!io_context_) {
385 return;
386 }
387
388 cleanup_timer_ = std::make_unique<asio::steady_timer>(*io_context_);
389 cleanup_timer_->expires_after(std::chrono::seconds(30));
390 cleanup_timer_->async_wait([this](std::error_code ec) {
391 if (!ec && is_running_) {
394 }
395 });
396 }

◆ start_tls()

auto kcenon::network::protocols::http2::http2_server::start_tls ( unsigned short port,
const tls_config & config ) -> VoidResult

Start HTTP/2 server with TLS.

Parameters
portPort to listen on
configTLS configuration
Returns
Success or error

Starts the server with TLS and ALPN "h2" negotiation.

Definition at line 72 of file http2_server.cpp.

73 {
74 if (is_running_) {
75 return error_void(
77 "Server already running",
78 "http2_server");
79 }
80
81 try {
82 stop_io();
83 cleanup_timer_.reset();
84 acceptor_.reset();
85 ssl_context_.reset();
86 io_context_ = std::make_unique<asio::io_context>();
87 work_guard_ = std::make_unique<asio::executor_work_guard<asio::io_context::executor_type>>(
88 io_context_->get_executor());
89
90 // Setup TLS context
91 ssl_context_ = std::make_unique<asio::ssl::context>(asio::ssl::context::tls_server);
92 ssl_context_->set_options(
93 asio::ssl::context::default_workarounds |
94 asio::ssl::context::no_sslv2 |
95 asio::ssl::context::no_sslv3 |
96 asio::ssl::context::no_tlsv1 |
97 asio::ssl::context::no_tlsv1_1);
98
99 ssl_context_->use_certificate_file(config.cert_file, asio::ssl::context::pem);
100 ssl_context_->use_private_key_file(config.key_file, asio::ssl::context::pem);
101
102 if (!config.ca_file.empty()) {
103 ssl_context_->load_verify_file(config.ca_file);
104 }
105
106 if (config.verify_client) {
107 ssl_context_->set_verify_mode(asio::ssl::verify_peer | asio::ssl::verify_fail_if_no_peer_cert);
108 }
109
110 // Set ALPN callback for HTTP/2
111 SSL_CTX_set_alpn_select_cb(
112 ssl_context_->native_handle(),
113 [](SSL* /*ssl*/, const unsigned char** out, unsigned char* outlen,
114 const unsigned char* in, unsigned int inlen, void* /*arg*/) -> int {
115 // Look for "h2" in client's ALPN list
116 const unsigned char* client = in;
117 const unsigned char* end = in + inlen;
118 while (client < end) {
119 unsigned char len = *client++;
120 if (len == 2 && client + 2 <= end &&
121 client[0] == 'h' && client[1] == '2') {
122 *out = client;
123 *outlen = 2;
124 return SSL_TLSEXT_ERR_OK;
125 }
126 client += len;
127 }
128 return SSL_TLSEXT_ERR_NOACK;
129 },
130 nullptr);
131
132 acceptor_ = std::make_unique<asio::ip::tcp::acceptor>(
134 asio::ip::tcp::endpoint(asio::ip::tcp::v4(), port));
135
136 use_tls_ = true;
137 is_running_ = true;
138
139 // Start I/O thread
140 io_future_ = std::async(std::launch::async, [this]() { run_io(); });
141
142 // Start accepting connections
145
146 return ok();
147 } catch (const std::exception& e) {
148 return error_void(
150 std::string("Failed to start TLS server: ") + e.what(),
151 "http2_server");
152 }
153 }
struct ssl_st SSL
Definition crypto.h:21

References kcenon::network::error_codes::common_errors::already_exists, config, kcenon::network::error_void(), and kcenon::network::ok().

Here is the call graph for this function:

◆ stop()

auto kcenon::network::protocols::http2::http2_server::stop ( ) -> VoidResult

Stop the server.

Returns
Success or error

Sends GOAWAY to all connections and stops accepting new connections.

Definition at line 155 of file http2_server.cpp.

156 {
157 if (!is_running_) {
158 return ok();
159 }
160
161 is_running_ = false;
162
163 // Prevent another callback from starting, and interrupt any response
164 // writer before waiting for the current callback to finish.
165 if (io_context_) {
166 io_context_->stop();
167 }
168 {
169 std::lock_guard<std::mutex> lock(connections_mutex_);
170 for (auto& [id, conn] : connections_) {
171 conn->shutdown_transport();
172 }
173 }
174
175 // A read or request callback can still be using a connection. Join
176 // the I/O worker before closing its sockets or releasing the map.
177 stop_io();
178
179 // Close acceptor
180 if (acceptor_ && acceptor_->is_open()) {
181 std::error_code ec;
182 acceptor_->close(ec);
183 }
184
185 // Stop all connections
186 {
187 std::lock_guard<std::mutex> lock(connections_mutex_);
188 for (auto& [id, conn] : connections_) {
189 conn->stop();
190 }
191 connections_.clear();
192 }
193
194 // Stop cleanup timer
195 if (cleanup_timer_) {
196 cleanup_timer_->cancel();
197 }
198
199 // Signal stop
200 try {
201 stop_promise_.set_value();
202 } catch (...) {
203 // Already set
204 }
205
206 return ok();
207 }

References kcenon::network::ok().

Referenced by ~http2_server().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stop_io()

auto kcenon::network::protocols::http2::http2_server::stop_io ( ) -> void
private

Definition at line 405 of file http2_server.cpp.

406 {
407 if (work_guard_) {
408 work_guard_.reset();
409 }
410
411 if (io_context_) {
412 io_context_->stop();
413 }
414
415 if (io_future_.valid()) {
416 io_future_.wait();
417 }
418 }

◆ wait()

auto kcenon::network::protocols::http2::http2_server::wait ( ) -> void

Wait for server to stop.

Blocks until stop() is called.

Definition at line 214 of file http2_server.cpp.

215 {
216 stop_future_.wait();
217 }

Member Data Documentation

◆ acceptor_

std::unique_ptr<asio::ip::tcp::acceptor> kcenon::network::protocols::http2::http2_server::acceptor_
private

Definition at line 238 of file http2_server.h.

◆ cleanup_timer_

std::unique_ptr<asio::steady_timer> kcenon::network::protocols::http2::http2_server::cleanup_timer_
private

Definition at line 266 of file http2_server.h.

◆ CONNECTION_PREFACE

std::string_view kcenon::network::protocols::http2::http2_server::CONNECTION_PREFACE
staticconstexprprivate
Initial value:
=
"PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"

Definition at line 269 of file http2_server.h.

◆ connections_

std::map<uint64_t, std::shared_ptr<http2_server_connection> > kcenon::network::protocols::http2::http2_server::connections_
private

Definition at line 254 of file http2_server.h.

◆ connections_mutex_

std::mutex kcenon::network::protocols::http2::http2_server::connections_mutex_
private

Definition at line 253 of file http2_server.h.

◆ decoder_

std::shared_ptr<hpack_decoder> kcenon::network::protocols::http2::http2_server::decoder_
private

Definition at line 263 of file http2_server.h.

◆ encoder_

std::shared_ptr<hpack_encoder> kcenon::network::protocols::http2::http2_server::encoder_
private

Definition at line 262 of file http2_server.h.

◆ error_handler_

error_handler_t kcenon::network::protocols::http2::http2_server::error_handler_
private

Definition at line 250 of file http2_server.h.

◆ FRAME_HEADER_SIZE

size_t kcenon::network::protocols::http2::http2_server::FRAME_HEADER_SIZE = 9
staticconstexprprivate

Definition at line 271 of file http2_server.h.

◆ io_context_

std::unique_ptr<asio::io_context> kcenon::network::protocols::http2::http2_server::io_context_
private

Definition at line 236 of file http2_server.h.

◆ io_future_

std::future<void> kcenon::network::protocols::http2::http2_server::io_future_
private

Definition at line 240 of file http2_server.h.

◆ is_running_

std::atomic<bool> kcenon::network::protocols::http2::http2_server::is_running_ {false}
private

Definition at line 243 of file http2_server.h.

243{false};

Referenced by ~http2_server().

◆ next_connection_id_

std::atomic<uint64_t> kcenon::network::protocols::http2::http2_server::next_connection_id_ {1}
private

Definition at line 255 of file http2_server.h.

255{1};

◆ request_handler_

request_handler_t kcenon::network::protocols::http2::http2_server::request_handler_
private

Definition at line 249 of file http2_server.h.

◆ server_id_

std::string kcenon::network::protocols::http2::http2_server::server_id_
private

Server identifier.

Definition at line 233 of file http2_server.h.

◆ settings_

http2_settings kcenon::network::protocols::http2::http2_server::settings_
private

Definition at line 259 of file http2_server.h.

◆ settings_mutex_

std::mutex kcenon::network::protocols::http2::http2_server::settings_mutex_
mutableprivate

Definition at line 258 of file http2_server.h.

◆ ssl_context_

std::unique_ptr<asio::ssl::context> kcenon::network::protocols::http2::http2_server::ssl_context_
private

Definition at line 237 of file http2_server.h.

◆ stop_future_

std::future<void> kcenon::network::protocols::http2::http2_server::stop_future_
private

Definition at line 246 of file http2_server.h.

◆ stop_promise_

std::promise<void> kcenon::network::protocols::http2::http2_server::stop_promise_
private

Definition at line 245 of file http2_server.h.

◆ use_tls_

std::atomic<bool> kcenon::network::protocols::http2::http2_server::use_tls_ {false}
private

Definition at line 244 of file http2_server.h.

244{false};

◆ work_guard_

std::unique_ptr<asio::executor_work_guard<asio::io_context::executor_type> > kcenon::network::protocols::http2::http2_server::work_guard_
private

Definition at line 239 of file http2_server.h.


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