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

TCP transport providing reliable, stream-based network communication. More...

#include <tcp.h>

Inheritance diagram for qb::io::transport::tcp:
Collaboration diagram for qb::io::transport::tcp:

Public Member Functions

constexpr bool is_secure () const noexcept
 Indicates that this transport implementation is not secure.
Public Member Functions inherited from qb::io::stream< io::tcp::socket >
output_buffer_typeout () noexcept
 Get the output buffer.
std::size_t pendingWrite () const noexcept
 Get the number of bytes pending for writing.
int write (std::enable_if_t< has_method_write< io::tcp::socket, int, const char *, std::size_t >::value, Available > *=nullptr) noexcept
 Write data from the output buffer to the transport.
char * publish (char const *data, std::size_t size) noexcept
 Add data to the output buffer for later writing.
void close () noexcept
 Close the stream.
Public Member Functions inherited from qb::io::istream< io::tcp::socket >
 ~istream () noexcept
 Destructor.
io::tcp::sockettransport () noexcept
 Get the underlying transport object.
input_buffer_typein () noexcept
 Get the input buffer.
std::size_t pendingRead () const noexcept
 Get the number of bytes available for reading.
int read (std::enable_if_t< has_method_read< io::tcp::socket, int, char *, std::size_t >::value, Available > *=nullptr) noexcept
 Read data from the transport into the input buffer.
void flush (std::size_t size) noexcept
 Remove data from the front of the input buffer.
void eof () noexcept
 Handle end-of-file condition.
void close () noexcept
 Close the stream.

Additional Inherited Members

Public Types inherited from qb::io::stream< io::tcp::socket >
using transport_io_type
 Type of the underlying transport IO.
using output_buffer_type
 Type of the output buffer.
Public Types inherited from qb::io::istream< io::tcp::socket >
using transport_io_type
 Type of the underlying transport IO.
using input_buffer_type
 Type of the input buffer.
Static Public Attributes inherited from qb::io::stream< io::tcp::socket >
static constexpr const bool has_reset_on_pending_read
 Flag indicating whether the implementation resets pending reads.
Protected Attributes inherited from qb::io::stream< io::tcp::socket >
output_buffer_type _out_buffer
 Buffer for outgoing data.
Protected Attributes inherited from qb::io::istream< io::tcp::socket >
io::tcp::socket _in
 The underlying IO object.
input_buffer_type _in_buffer
 Buffer for incoming data.

Detailed Description

TCP transport providing reliable, stream-based network communication.

This class implements a transport layer for TCP sockets by extending the generic qb::io::stream class, specializing it with qb::io::tcp::socket as the underlying I/O mechanism. It inherits all stream functionality for buffered reading and writing and applies it to TCP connections (IPv4, IPv6, or Unix Sockets).