#include <endpoint.hpp>
Definition at line 29 of file endpoint.hpp.
libwire::endpoint::endpoint |
( |
const address & |
addr, |
|
|
uint16_t |
port |
|
) |
| |
libwire::endpoint::endpoint |
( |
const std::string_view & |
str | ) |
|
|
noexcept |
Parse endpoint information from string representation.
Input should have following format: "IP:PORT" (IPv4) or "[IP]:PORT" (IPv6).
If exceptions are enabled - will throw std::invalid_argument, otherwise constructed address will have is_invalid() = true.
bool libwire::endpoint::is_invalid |
( |
| ) |
const |
|
noexcept |
Returns true if endpoint struct have invalid contents because of c-tor failure.
- Note
- Invalid values can be safetly used as a "null" endpoint.
bool libwire::endpoint::operator!= |
( |
const endpoint & |
rhs | ) |
const |
|
noexcept |
bool libwire::endpoint::operator== |
( |
const endpoint & |
rhs | ) |
const |
|
noexcept |
std::string libwire::endpoint::to_string |
( |
| ) |
const |
|
noexcept |
Convert endpoint type to string representation.
Result format is "IP:PORT" for IPv4 and "[IP]:PORT" for IPv6.
const endpoint libwire::endpoint::invalid |
|
static |
uint16_t libwire::endpoint::port |