#include <evo/impl/sysio_sock.h>
Resolves socket name/address to socket address info.
- This wraps socket getaddrinfo() and addrinfo structures
- A name/address may resolve to multiple interfaces
- You can set hints directly, or use helpers like tcp() or udp()
- Call resolve() or convert() to resolve a host/port
|
static const int | NUMERIC = AI_NUMERICHOST | AI_NUMERICHOST |
| Flags for numeric host address and port. More...
|
|
◆ SocketAddressInfo()
Constructor.
- Parameters
-
family | Address family to use, common values: AF_INET for IPv4, AF_INET6 for IPv6 |
◆ ~SocketAddressInfo()
◆ convert() [1/3]
Error convert |
( |
const char * |
host | ) |
|
|
inline |
Convert host address to one or more socket addresses.
- This is like resolve() but doesn't call an external service (like DNS) so doesn't block
- Parameters
-
host | Host address to convert/resolve (terminated string) |
- Returns
- ENone for success, ENotFound if host not found, otherwise error code
◆ convert() [2/3]
Error convert |
( |
const char * |
host, |
|
|
ushort |
port |
|
) |
| |
|
inline |
Convert host address to one or more socket addresses.
- This is like resolve() but doesn't call an external service (like DNS) so doesn't block
- Parameters
-
host | Host address to resolve (terminated string) |
port | Port number to use |
- Returns
- ENone for success, ENotFound if host not found, otherwise error code
◆ convert() [3/3]
Convert host address to one or more socket addresses.
- This is like resolve() but doesn't call an external service (like DNS) so doesn't block
- Parameters
-
host | Host address to resolve (terminated string) |
port | Port number to use, 0 for none |
- Returns
- ENone for success, ENotFound if host not found, otherwise error code
◆ free()
Free results allocated from resolve() or resolve_address.
- This is called automatically by destructor or next resolve() call
◆ reset()
Reset data.
- Parameters
-
family | Address family to use, common values: AF_INET for IPv4, AF_INET6 for IPv6 |
- Returns
- This
◆ resolve() [1/3]
Error resolve |
( |
const char * |
host, |
|
|
const char * |
port = NULL , |
|
|
int |
flags = AI_NUMERICSERV |
|
) |
| |
|
inline |
Resolve or convert host name/address and port to one or more socket addresses.
- By default this may block while calling external services like DNS, unless flags disables this
- Parameters
-
host | Host name or address to resolve (terminated string) |
port | Port number or service name to resolve (terminated string), NULL to skip |
flags | Flags, use default or NUMERIC, or see getaddrinfo() for more |
- Returns
- ENone for success, ENotFound if host not found, otherwise error code
◆ resolve() [2/3]
Error resolve |
( |
const char * |
host, |
|
|
ushort |
port, |
|
|
int |
flags = 0 |
|
) |
| |
|
inline |
Resolve host name/address and port to one or more socket addresses.
- By default this may block while calling external services (like DNS)
- Parameters
-
host | Host name or address to resolve (terminated string) |
port | Port number to use |
flags | Flags, use default or NUMERIC, or see getaddrinfo() for more |
- Returns
- ENone for success, ENotFound if host not found, otherwise error code
◆ resolve() [3/3]
Error resolve |
( |
const SubString & |
host, |
|
|
ushort |
port = 0 , |
|
|
int |
flags = 0 |
|
) |
| |
|
inline |
Resolve or convert host name/address and port to one or more socket addresses.
- By default this may block while calling external services like DNS, unless flags disables this
- Parameters
-
host | Host name or address to resolve |
port | Port number to use, 0 for none |
flags | Flags, use default or NUMERIC, or see getaddrinfo() for more |
- Returns
- ENone for success, ENotFound if host not found, otherwise error code
◆ tcp()
Setup for resolving to TCP address.
- Returns
- This
◆ udp()
Setup for resolving to UDP address.
- Returns
- This
◆ code
◆ hints
◆ NUMERIC
const int NUMERIC = AI_NUMERICHOST | AI_NUMERICHOST |
|
static |
Flags for numeric host address and port.
◆ ptr
Pointer to first address in resolve results.
The documentation for this struct was generated from the following file: