#include <endpoint.hpp>
|
using | address_type = IPAddressType |
|
template<IPAddress IPAddressType>
class fly::net::Endpoint< IPAddressType >
Class to store a version-independent IP address and port, and to provide convenient access to its data as required by various network APIs.
- Author
- Timothy Flynn (trfly.nosp@m.nn89.nosp@m.@pm.m.nosp@m.e)
- Version
- February 13, 2021
◆ Endpoint() [1/3]
template<IPAddress IPAddressType>
◆ Endpoint() [2/3]
template<IPAddress IPAddressType>
Constructor. Create an endpoint from an IP address and port.
- Parameters
-
address | The IP address to initialize the endpoint with. |
port | The port to initialize the endpoint with. |
◆ Endpoint() [3/3]
template<IPAddress IPAddressType>
Constructor. Create an endpoint from an IP address and port.
- Parameters
-
address | The IP address to initialize the endpoint with. |
port | The port to initialize the endpoint with. |
◆ address()
template<IPAddress IPAddressType>
- Returns
- The endoint's IP address.
◆ from_string()
template<IPAddress IPAddressType>
constexpr std::optional< Endpoint< IPAddressType > > fly::net::Endpoint< IPAddressType >::from_string |
( |
std::string_view |
endpoint | ) |
|
|
staticconstexpr |
Construct an endpoint from a string containing an IP address and a port.
The provided string should begin with the IP address and end with the port, separated by a single colon. IPv6 addressses should be surrounded by square brackets (e.g. "[::1]:80");
- Parameters
-
endpoint | The string to initialize the endpoint from. |
- Returns
- If successful, the constructed endpoint. Otherwise, an uninitialized value.
◆ is_ipv4()
template<IPAddress IPAddressType>
- Returns
- True if this is an IPv4 endpoint.
◆ is_ipv6()
template<IPAddress IPAddressType>
- Returns
- True if this is an IPv6 endpoint.
◆ operator<=>()
template<IPAddress IPAddressType>
Three-way-comparison operator. Defaulted to perform the comparison on the underlying IP address and port.
◆ port()
template<IPAddress IPAddressType>
- Returns
- The endoint's IP port.
The documentation for this class was generated from the following file: