25#ifndef JOIN_CRYPTO_TLS_WRAPPER_HPP
26#define JOIN_CRYPTO_TLS_WRAPPER_HPP
36 template <
class Protocol>
52 return this->
_socket.connecting ();
61 return this->
_socket.waitConnected ();
71 return this->
_socket.waitConnected (timeout);
81 return this->
_socket.waitConnected (deadline);
90 return this->
_socket.waitDisconnected ();
100 return this->
_socket.waitDisconnected (timeout);
110 return this->
_socket.waitDisconnected (deadline);
124 if (!this->
_socket.waitConnected (deadline))
141 return SSL_pending (this->
_ssl.get ());
144 return this->
_socket.canRead ();
154 template <
class Protocol>
157 return a.handle () < b.handle ();
TLS decorator for stream sockets.
Definition tls_wrapper.hpp:38
bool waitDisconnected()
block until the underlying socket is disconnected.
Definition tls_wrapper.hpp:88
bool waitHandshake(TimePoint deadline) override
block until TLS handshake is finished, giving up at the given time point.
Definition tls_wrapper.hpp:122
bool waitConnected(std::chrono::nanoseconds timeout)
block until the underlying socket is connected, giving up after the given duration.
Definition tls_wrapper.hpp:69
typename BasicTls< Protocol >::TimePoint TimePoint
Definition tls_wrapper.hpp:41
bool waitConnected()
block until the underlying socket is connected.
Definition tls_wrapper.hpp:59
typename BasicTls< Protocol >::Endpoint Endpoint
Definition tls_wrapper.hpp:40
bool waitConnected(TimePoint deadline)
block until the underlying socket is connected, giving up at the given time point.
Definition tls_wrapper.hpp:79
bool waitDisconnected(std::chrono::nanoseconds timeout)
block until the underlying socket is disconnected, giving up after the given duration.
Definition tls_wrapper.hpp:98
int canRead() const noexcept
get the number of readable bytes.
Definition tls_wrapper.hpp:137
bool connecting() const noexcept
check if the underlying socket is connecting.
Definition tls_wrapper.hpp:50
bool waitDisconnected(TimePoint deadline)
block until the underlying socket is disconnected, giving up at the given time point.
Definition tls_wrapper.hpp:108
basic TLS/DTLS decorator.
Definition tls.hpp:54
bool waitHandshake()
block until TLS handshake is finished.
Definition tls.hpp:350
BasicTls(TlsContext ctx, Mode mode=Mode::NonBlocking) noexcept
create a TLS decorator with an internally created socket.
Definition tls.hpp:68
UnderlyingSocket _socket
verify certificate revocation using CRL.
Definition tls.hpp:1199
typename Protocol::Endpoint Endpoint
Definition tls.hpp:60
SslPtr _ssl
TLS handle.
Definition tls.hpp:1205
typename UnderlyingSocket::TimePoint TimePoint
Definition tls.hpp:61
Definition acceptor.hpp:32
bool operator<(const BasicDatagramSocket< Protocol > &a, const BasicDatagramSocket< Protocol > &b) noexcept
compare if socket handle is inferior.
Definition datagram_socket.hpp:394