26#ifndef ROUTER_SRC_OPENSSL_INCLUDE_TLS_TLS_STREAM_H_
27#define ROUTER_SRC_OPENSSL_INCLUDE_TLS_TLS_STREAM_H_
46template <
typename LowerLayer>
79 template <
class CompletionToken>
83 lower_layer().async_connect(endpoint, std::forward<CompletionToken>(token));
86 template <
class CompletionToken>
89 assert(
false &&
"Server handshake is not supported.");
95 io_token(*
this, {}, token);
100 template <
class MutableBufferSequence,
class CompletionToken>
102 CompletionToken &&token) {
105 io_token(*
this, buffers, token);
110 template <
class ConstBufferSequence,
class CompletionToken>
112 CompletionToken &&user_token) {
118 io_token(*
this, buffers, user_token);
123 template <
typename ConstBufferSequence>
130 auto handle_write_done = [&
result](std::error_code ec,
size_t s) {
138 it(*
this, buffers, std::move(handle_write_done), sync_action);
142 while (handle_result) {
143 switch (handle_result.value()) {
144 case Operation::Result::want_read:
148 case Operation::Result::want_write:
160 template <
typename MutableBufferSequence>
165 auto handle_read_done = [&
result, &
total](std::error_code ec,
size_t s) {
174 it(*
this, buffers, std::move(handle_read_done), sync_action);
178 while (handle_result) {
179 switch (handle_result.value()) {
180 case Operation::Result::want_read:
184 case Operation::Result::want_write:
196 template <
typename SettableSocketOption>
198 const SettableSocketOption &option) {
Definition: ssl_operation.h:165
Definition: ssl_io_completion.h:129
Definition: ssl_operation.h:99
Definition: ssl_operation.h:132
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:47
auto connect(const endpoint_type &endpoint)
Definition: tls_stream.h:73
auto native_handle()
Definition: tls_stream.h:204
Parent::LowerLayerType & lower_layer()
Definition: tls_stream.h:63
auto async_receive(const MutableBufferSequence &buffers, CompletionToken &&token)
Definition: tls_stream.h:101
const Parent::LowerLayerType & lower_layer() const
Definition: tls_stream.h:67
auto release()
Definition: tls_stream.h:203
auto async_handshake(HandshakeType type, CompletionToken &&token)
Definition: tls_stream.h:87
typename LowerLayer::endpoint_type endpoint_type
Definition: tls_stream.h:51
auto cancel()
Definition: tls_stream.h:61
auto get_executor()
Definition: tls_stream.h:60
auto async_connect(const endpoint_type &endpoint, CompletionToken &&token)
Definition: tls_stream.h:80
auto close()
Definition: tls_stream.h:202
auto async_send(const ConstBufferSequence &buffers, CompletionToken &&user_token)
Definition: tls_stream.h:111
Io_result_type read_some(const MutableBufferSequence &buffers)
Definition: tls_stream.h:161
stdx::expected< void, std::error_code > set_option(const SettableSocketOption &option)
Definition: tls_stream.h:197
bool is_open() const
Definition: tls_stream.h:71
void set_parent(const char *)
Definition: tls_stream.h:58
Io_result_type write_some(const ConstBufferSequence &buffers)
Definition: tls_stream.h:124
Type total(const Shards< COUNT > &shards) noexcept
Get the total value of all shards.
Definition: ut0counter.h:333
HandshakeType
Definition: tls_stream.h:44
@ kServer
Definition: tls_stream.h:44
@ kClient
Definition: tls_stream.h:44
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
required string type
Definition: replication_group_member_actions.proto:34