![]() |
jsocketpp 1.0
A cross-platform C++20 socket library.
|
Internal types, platform abstractions, and utility functions used across the jsocketpp library. More...
Namespaces | |
namespace | jsocketpp::net |
Endianness utilities for network byte order conversion. |
Classes | |
struct | jsocketpp::BufferView |
Represents a raw writable memory region for scatter/gather I/O. More... |
Typedefs | |
using | jsocketpp::Port = std::uint16_t |
Type alias representing a TCP or UDP port number (1–65535). |
Functions | |
bool | jsocketpp::isIPv4MappedIPv6 (const sockaddr_in6 *addr6) |
Checks if a given sockaddr_in6 represents an IPv4-mapped IPv6 address. | |
sockaddr_in | jsocketpp::convertIPv4MappedIPv6ToIPv4 (const sockaddr_in6 &addr6) |
Converts an IPv4-mapped IPv6 address to a pure IPv4 sockaddr_in. |
Variables | |
constexpr std::size_t | jsocketpp::DefaultBufferSize = 4096 |
Default internal buffer size (in bytes) for TCP socket read operations. |
Internal types, platform abstractions, and utility functions used across the jsocketpp library.
This group contains foundational components of the jsocketpp socket library, including common type aliases, byte-order conversion utilities, and cross-platform compatibility helpers.
Components in this group are typically not used directly by application-level code, but are essential for internal implementation and protocol correctness.
using jsocketpp::Port = std::uint16_t |
Type alias representing a TCP or UDP port number (1–65535).
This alias provides strong typing for network port numbers across the jsocketpp library. It improves readability and makes function signatures semantically clearer when dealing with socket operations.
Using Port instead of a plain uint16_t or unsigned short helps:
|
inline |
Converts an IPv4-mapped IPv6 address to a pure IPv4 sockaddr_in.
This function extracts the embedded IPv4 address from an IPv4-mapped IPv6 address. It preserves the port number and fills a fully valid sockaddr_in.
addr6 | A sockaddr_in6 known to be IPv4-mapped. |
|
inline |
Checks if a given sockaddr_in6 represents an IPv4-mapped IPv6 address.
IPv4-mapped IPv6 addresses allow IPv6-only sockets to interoperate with IPv4 clients by embedding an IPv4 address inside a special IPv6 format:
This function identifies such addresses so they can be normalized to pure IPv4.
addr6 | Pointer to a sockaddr_in6 structure. |
|
inlineconstexpr |
Default internal buffer size (in bytes) for TCP socket read operations.
This constant defines the default size (4096 bytes / 4 KB) of the internal read buffer used by both Socket and ServerSocket instances unless explicitly overridden.
It applies to: