qb
2.0.0.0
C++17 Actor Framework
|
Connection acceptance transport for TCP connections. More...
#include <accept.h>
Public Types | |
using | transport_io_type = io::tcp::listener |
Type of the underlying transport I/O. | |
using | socket_type = io::tcp::socket |
Type of the accepted socket. |
Public Member Functions | |
constexpr bool | is_secure () const noexcept |
Indicates that this transport implementation is not secure. | |
io::tcp::listener & | transport () noexcept |
Get the underlying TCP listener. | |
std::size_t | read () noexcept |
Accept a new connection. | |
void | flush (std::size_t) noexcept |
Release the accepted socket handle. | |
void | eof () const noexcept |
End-of-file handling (no-op) | |
void | close () noexcept |
Close the listener. | |
io::tcp::socket & | getAccepted () |
Get the accepted socket. |
Connection acceptance transport for TCP connections.
This class implements a transport layer specific to accepting incoming TCP connections. It wraps a qb::io::tcp::listener and is primarily used as the IO type (_IO_) for stream classes (like qb::io::istream) when building acceptor components (e.g., qb::io::async::tcp::acceptor).
Its read() method attempts to accept a new connection via the listener, and getAccepted() provides access to the newly accepted qb::io::tcp::socket.
|
inlinenoexcept |
Get the underlying TCP listener.
|
inlinenoexcept |
Accept a new connection.
Attempts to accept a new connection. If successful, returns the native handle of the accepted socket which can be used for further communication.
|
inlinenoexcept |
Release the accepted socket handle.
Unused | parameter |
Releases the handle of the last accepted socket to prevent it from being closed when the socket object is destroyed.
|
inlinenoexcept |
End-of-file handling (no-op)
This is a placeholder method with no implementation as connection acceptance doesn't have an EOF concept.
|
inlinenoexcept |
Close the listener.
Closes the underlying TCP listener, stopping the acceptance of new connections.
|
inline |
Get the accepted socket.
Returns a reference to the socket object representing the last accepted connection.