qb  2.0.0.0
C++17 Actor Framework
qb Issue Watch Star Fork Follow @isndev
Loading...
Searching...
No Matches
qb::io::transport::saccept Class Reference

Secure connection acceptance transport for SSL/TLS TCP connections. More...

#include <saccept.h>

Public Types

using transport_io_type = io::tcp::ssl::listener
 Type of the underlying transport I/O.
using socket_type = io::tcp::ssl::socket
 Type of the accepted socket.

Public Member Functions

constexpr bool is_secure () const noexcept
 Indicates that this transport implementation is secure.
io::tcp::ssl::listenertransport () noexcept
 Get the underlying SSL TCP listener.
std::size_t read () noexcept
 Accept a new secure connection.
void flush (std::size_t) noexcept
 Reset the accepted socket.
void eof () const noexcept
 End-of-file handling (no-op)
void close () noexcept
 Close the listener.
io::tcp::ssl::socketgetAccepted ()
 Get the accepted secure socket.

Detailed Description

Secure connection acceptance transport for SSL/TLS TCP connections.

This class implements a transport layer for accepting incoming secure (SSL/TLS) TCP connections. It wraps a qb::io::tcp::ssl::listener and is used similarly to qb::io::transport::accept, but for encrypted connections.

Its read() method attempts to accept a new secure connection, performing the SSL handshake, and getAccepted() provides access to the newly established qb::io::tcp::ssl::socket.

Member Function Documentation

◆ transport()

io::tcp::ssl::listener & qb::io::transport::saccept::transport ( )
inlinenoexcept

Get the underlying SSL TCP listener.

Returns
Reference to the SSL TCP listener

◆ read()

std::size_t qb::io::transport::saccept::read ( )
inlinenoexcept

Accept a new secure connection.

Returns
Native handle of the accepted socket, or -1 on failure

Attempts to accept a new secure connection. If successful, returns the native handle of the accepted socket which can be used for further secure communication.

◆ flush()

void qb::io::transport::saccept::flush ( std::size_t )
inlinenoexcept

Reset the accepted socket.

Parameters
Unusedparameter

Resets the last accepted socket by replacing it with a new default-constructed socket, effectively releasing the previous connection.

◆ eof()

void qb::io::transport::saccept::eof ( ) const
inlinenoexcept

End-of-file handling (no-op)

This is a placeholder method with no implementation as connection acceptance doesn't have an EOF concept.

◆ close()

void qb::io::transport::saccept::close ( )
inlinenoexcept

Close the listener.

Closes the underlying SSL TCP listener, stopping the acceptance of new secure connections.

◆ getAccepted()

io::tcp::ssl::socket & qb::io::transport::saccept::getAccepted ( )
inline

Get the accepted secure socket.

Returns
Reference to the last accepted secure socket

Returns a reference to the SSL socket object representing the last accepted secure connection.