26#ifndef ROUTER_SRC_OPENSSL_INCLUDE_TLS_TLS_STREAM_H_
27#define ROUTER_SRC_OPENSSL_INCLUDE_TLS_TLS_STREAM_H_
44template <
typename LowerLayer>
77 template <
class CompletionToken>
81 lower_layer().async_connect(endpoint, std::forward<CompletionToken>(token));
84 template <
class MutableBufferSequence,
class CompletionToken>
86 CompletionToken &&token) {
89 io_token(*
this, buffers, token);
94 template <
class ConstBufferSequence,
class CompletionToken>
96 CompletionToken &&user_token) {
102 io_token(*
this, buffers, user_token);
107 template <
typename ConstBufferSequence>
114 auto handle_write_done = [&
result](std::error_code ec,
size_t s) {
122 it(*
this, buffers, std::move(handle_write_done), sync_action);
126 while (handle_result) {
127 switch (handle_result.value()) {
128 case Operation::Result::want_read:
132 case Operation::Result::want_write:
144 template <
typename MutableBufferSequence>
149 auto handle_read_done = [&
result, &
total](std::error_code ec,
size_t s) {
158 it(*
this, buffers, std::move(handle_read_done), sync_action);
162 while (handle_result) {
163 switch (handle_result.value()) {
164 case Operation::Result::want_read:
168 case Operation::Result::want_write:
180 template <
typename SettableSocketOption>
182 const SettableSocketOption &option) {
Definition: ssl_io_completion.h:129
Definition: ssl_operation.h:98
Definition: ssl_operation.h:131
Definition: ssl_io_completion.h:85
Handler_result handle_write_result(Handler *handler)
Definition: ssl_io_completion.h:102
Handler_result handle_read_result(Handler *handler)
Definition: ssl_io_completion.h:113
Definition: tls_base.h:42
LowerLayer lower_layer_
Definition: tls_base.h:95
LowerLayer LowerLayerType
Definition: tls_base.h:68
TlsBase(LowerLayer &&layer, TlsContext *tls_context)
Definition: tls_base.h:56
Definition: tls_stream.h:45
auto connect(const endpoint_type &endpoint)
Definition: tls_stream.h:71
auto native_handle()
Definition: tls_stream.h:188
Parent::LowerLayerType & lower_layer()
Definition: tls_stream.h:61
auto async_receive(const MutableBufferSequence &buffers, CompletionToken &&token)
Definition: tls_stream.h:85
const Parent::LowerLayerType & lower_layer() const
Definition: tls_stream.h:65
auto release()
Definition: tls_stream.h:187
typename LowerLayer::endpoint_type endpoint_type
Definition: tls_stream.h:49
auto cancel()
Definition: tls_stream.h:59
auto get_executor()
Definition: tls_stream.h:58
auto async_connect(const endpoint_type &endpoint, CompletionToken &&token)
Definition: tls_stream.h:78
auto close()
Definition: tls_stream.h:186
auto async_send(const ConstBufferSequence &buffers, CompletionToken &&user_token)
Definition: tls_stream.h:95
Io_result_type read_some(const MutableBufferSequence &buffers)
Definition: tls_stream.h:145
stdx::expected< void, std::error_code > set_option(const SettableSocketOption &option)
Definition: tls_stream.h:181
bool is_open() const
Definition: tls_stream.h:69
void set_parent(const char *)
Definition: tls_stream.h:56
Io_result_type write_some(const ConstBufferSequence &buffers)
Definition: tls_stream.h:108
Type total(const Shards< COUNT > &shards) noexcept
Get the total value of all shards.
Definition: ut0counter.h:333
constexpr unexpect_t unexpect
Definition: expected.h:109
unexpected(E) -> unexpected< E >
Definition: tls_keylog_dumper.h:32
struct result result
Definition: result.h:34