Generic socket address.
More...
#include <sock_address.h>
Generic socket address.
This is a wrapper around sockaddr_storage
which can hold any family address. This should have enough memory to contain any address struct for the system on which it is compiled.
◆ sock_address_any() [1/4]
sockpp::sock_address_any::sock_address_any |
( |
| ) |
|
|
inline |
Constructs an empty address.
The address is initialized to all zeroes.
◆ sock_address_any() [2/4]
sockpp::sock_address_any::sock_address_any |
( |
const sockaddr * |
addr, |
|
|
socklen_t |
n |
|
) |
| |
|
inline |
Constructs an address.
- Parameters
-
addr | Pointer to a buffer holding the address. |
n | The number of valid bytes in the address |
- Exceptions
-
std::length_error | if n is greater than the maximum size of an address. |
◆ sock_address_any() [3/4]
sockpp::sock_address_any::sock_address_any |
( |
const sockaddr_storage & |
addr, |
|
|
socklen_t |
n |
|
) |
| |
|
inline |
Constructs an address.
- Parameters
-
addr | The buffer holding the address. |
n | The number of valid bytes in the address |
- Exceptions
-
std::length_error | if n is greater than the maximum size of an address. |
◆ sock_address_any() [4/4]
sockpp::sock_address_any::sock_address_any |
( |
const sock_address & |
addr | ) |
|
|
inline |
Copies another address to this one.
- Parameters
-
addr | The other address to copy into this one. |
◆ size()
socklen_t sockpp::sock_address_any::size |
( |
| ) |
const |
|
inlineoverridevirtual |
Gets the size of the address.
- Returns
- The size of the address. This is the number of bytes that are a valid part of the address.
Implements sockpp::sock_address.
◆ sockaddr_ptr() [1/2]
const sockaddr* sockpp::sock_address_any::sockaddr_ptr |
( |
| ) |
const |
|
inlineoverridevirtual |
Gets a pointer to this object cast to a sockaddr.
- Returns
- A pointer to this object cast to a sockaddr.
Implements sockpp::sock_address.
◆ sockaddr_ptr() [2/2]
sockaddr* sockpp::sock_address_any::sockaddr_ptr |
( |
| ) |
|
|
inlineoverridevirtual |
Gets a pointer to this object cast to a sockaddr.
- Returns
- A pointer to this object cast to a sockaddr.
Implements sockpp::sock_address.
The documentation for this class was generated from the following file: