Native socket address wrapper.
More...
#include <userver/engine/io/sockaddr.hpp>
|
| | Sockaddr () |
| | Constructs an unspecified native socket address.
|
| |
| | Sockaddr (const void *data) |
| | Wraps a native socket address structure.
|
| |
| template<typename T > |
| T * | As () |
| | Domain-specific native socket address structure pointer.
|
| |
| template<typename T > |
| const T * | As () const |
| | Domain-specific native socket address structure pointer.
|
| |
| struct sockaddr * | Data () |
| | Native socket address structure pointer.
|
| |
| const struct sockaddr * | Data () const |
| | Native socket address structure pointer.
|
| |
| socklen_t | Size () const |
| | Maximum supported native socket address structure size.
|
| |
| socklen_t | Capacity () const |
| | Maximum supported native socket address structure size.
|
| |
| sa_family_t | Family () const |
| | Protocol family.
|
| |
| AddrDomain | Domain () const |
| | Communication domain.
|
| |
|
bool | HasPort () const |
| | Whether the stored socket address family expects a port.
|
| |
|
int | Port () const |
| | Returns the stored port number if available, otherwise throws.
|
| |
|
void | SetPort (int port) |
| | Sets a port for address families that allow for one, otherwise throws.
|
| |
| std::string | PrimaryAddressString () const |
| | Human-readable address representation.
|
| |
|
| static constexpr socklen_t | Addrlen (AddrDomain domain) |
| | Domain-specific native socket address structure size.
|
| |
Native socket address wrapper.
Definition at line 42 of file sockaddr.hpp.
◆ Sockaddr() [1/2]
| engine::io::Sockaddr::Sockaddr |
( |
| ) |
|
|
inline |
Constructs an unspecified native socket address.
Definition at line 46 of file sockaddr.hpp.
◆ Sockaddr() [2/2]
| engine::io::Sockaddr::Sockaddr |
( |
const void * |
data | ) |
|
|
inlineexplicit |
Wraps a native socket address structure.
- Warning
- sa_family must contain a correct address family.
Definition at line 51 of file sockaddr.hpp.
◆ Addrlen()
| static constexpr socklen_t engine::io::Sockaddr::Addrlen |
( |
AddrDomain |
domain | ) |
|
|
inlinestaticconstexpr |
Domain-specific native socket address structure size.
Definition at line 107 of file sockaddr.hpp.
◆ As() [1/2]
template<typename T >
| T * engine::io::Sockaddr::As |
( |
| ) |
|
|
inline |
Domain-specific native socket address structure pointer.
- Warning
- No type checking is performed, user must ensure that only the correct domain is accessed.
Definition at line 61 of file sockaddr.hpp.
◆ As() [2/2]
template<typename T >
| const T * engine::io::Sockaddr::As |
( |
| ) |
const |
|
inline |
Domain-specific native socket address structure pointer.
- Warning
- No type checking is performed, user must ensure that only the correct domain is accessed.
Definition at line 70 of file sockaddr.hpp.
◆ Capacity()
| socklen_t engine::io::Sockaddr::Capacity |
( |
| ) |
const |
|
inline |
Maximum supported native socket address structure size.
Definition at line 85 of file sockaddr.hpp.
◆ Data() [1/2]
| struct sockaddr * engine::io::Sockaddr::Data |
( |
| ) |
|
|
inline |
Native socket address structure pointer.
Definition at line 76 of file sockaddr.hpp.
◆ Data() [2/2]
| const struct sockaddr * engine::io::Sockaddr::Data |
( |
| ) |
const |
|
inline |
Native socket address structure pointer.
Definition at line 79 of file sockaddr.hpp.
◆ Domain()
◆ Family()
| sa_family_t engine::io::Sockaddr::Family |
( |
| ) |
const |
|
inline |
◆ PrimaryAddressString()
| std::string engine::io::Sockaddr::PrimaryAddressString |
( |
| ) |
const |
Human-readable address representation.
- Note
- Does not include port number.
◆ Size()
| socklen_t engine::io::Sockaddr::Size |
( |
| ) |
const |
|
inline |
Maximum supported native socket address structure size.
Definition at line 82 of file sockaddr.hpp.
The documentation for this class was generated from the following file: