Socket IP address instance handle. More...
#include <socket.hpp>
Public Member Functions | |
| SocketAddress (const SocketAddress &)=delete | |
| SocketAddress (SocketAddress &&r) noexcept | |
| SocketAddress & | operator= (SocketAddress &)=delete |
| SocketAddress & | operator= (SocketAddress &&r) noexcept |
| SocketAddress (SocketFamily family=IP_V6_SOCKET_FAMILY) | |
| Creates a new any socket IP address instance. | |
| SocketAddress (const char *host, const char *service) | |
| Creates a new socket IP address instance. | |
| ~SocketAddress () | |
| Destroys socket IP address instance. | |
| SocketAddress | createCopy () const noexcept |
| Creates a new socket IP address copy instance. | |
| void | destroy () noexcept |
| Destroys socket IP address instance. | |
| SocketAddress_T * | getInstance () const noexcept |
| Returns socket IP address view instance. | |
| SocketFamily | getFamily () const noexcept |
| Returns socket IP address family type. | |
| size_t | getIpSize () const noexcept |
| Returns socket IP address byte array size. | |
| bool | isAny () const noexcept |
| Returns true if socket IP address is any address. | |
| bool | isLoopback () const noexcept |
| Returns true if socket IP address is loopback address. | |
| bool | isMappedV4 () const noexcept |
| Returns true if socket IP address is IPv4 mapped IPv6. | |
| const uint8_t * | getIP () const noexcept |
| Returns socket IP address byte array. | |
| void | setIP (const uint8_t *ip) noexcept |
| Sets socket IP address byte array. | |
| uint16_t | getPort () const noexcept |
| Returns socket IP address port number. | |
| void | setPort (uint16_t port) noexcept |
| Sets socket IP address port number. | |
| void | getHost (char *host, size_t length) const noexcept |
| Returns socket IP address numeric host name. | |
| void | getHost (std::string &host) const |
| Returns socket IP address numeric host name. | |
| void | getService (char *service, size_t length) const noexcept |
| Returns socket IP address numeric service name. | |
| void | getService (std::string &service) const |
| Returns socket IP address numeric service name. | |
| void | getHostService (char *host, size_t hostLength, char *service, size_t serviceLength) const noexcept |
| Returns socket IP address numeric host and service name. | |
| void | getHostService (std::string &host, std::string &service) const |
| Returns socket IP address numeric host and service name. | |
| operator bool () const noexcept | |
| Returns true if socket IP address view is not null. | |
Static Public Member Functions | |
| static void | destroy (SocketAddressView *socketAddresses, size_t addressCount) noexcept |
| Destroys resolved socket IP address array. | |
| static NetsResult | resolve (const char *host, const char *service, SocketFamily family, SocketType type, SocketAddressView *&socketAddresses, size_t &addressCount) noexcept |
| Resolves a new socket IP address array. (Blocking call). | |
| static void | copy (SocketAddressView sourceAddress, SocketAddressView destinationAddress) noexcept |
| Copies source socket IP address to the destination. | |
| static int | compare (SocketAddressView a, SocketAddressView b) noexcept |
| Compares two socket IP addresses. | |
Protected Attributes | |
| SocketAddress_T * | instance = nullptr |
|
inline |
Creates a new any socket IP address instance.
See the createAnySocketAddress().
| family | socket IP address family type |
| Error | with a NetsResult string on failure. |
|
inline |
Creates a new socket IP address instance.
See the createSocketAddress().
| [in] | host | socket IP address host name string |
| [in] | service | socket IP address service name string (port) |
| Error | with a NetsResult string on failure. |
|
inline |
Destroys socket IP address instance.
See the destroySocketAddress().
|
inlinenoexcept |
Creates a new socket IP address copy instance.
See the createSocketAddressCopy().
|
inlinenoexceptinherited |
Destroys socket IP address instance.
See the destroySocketAddress().
|
inlinestaticnoexceptinherited |
Destroys resolved socket IP address array.
See the destroySocketAddresses().
| [in] | socketAddresses | socket IP address array |
| addressCount | socket address count |
|
inlinenoexceptinherited |
Returns socket IP address family type.
See the getSocketAddressFamily().
|
inlinenoexceptinherited |
Returns socket IP address byte array size.
See the getSocketAddressIpSize().
|
inlinenoexceptinherited |
Returns true if socket IP address is any address.
See the isSocketAddressAny().
|
inlinenoexceptinherited |
Returns true if socket IP address is loopback address.
See the isSocketAddressLoopback().
|
inlinenoexceptinherited |
Returns true if socket IP address is IPv4 mapped IPv6.
See the isSocketAddressMappedV4().
|
inlinenoexceptinherited |
Returns socket IP address byte array.
See the getSocketAddressIP().
|
inlinenoexceptinherited |
Sets socket IP address byte array.
See the setSocketAddressIP().
| [in] | ip | target IP address byte array |
|
inlinenoexceptinherited |
Returns socket IP address port number.
See the getSocketAddressPort().
|
inlinenoexceptinherited |
Sets socket IP address port number.
See the setSocketAddressPort().
| port | target IP address port number |
|
inlinenoexceptinherited |
Returns socket IP address numeric host name.
See the getSocketAddressHost().
| [out] | host | pointer to the host name string |
| length | host name string length (including null terminator) |
|
inlineinherited |
Returns socket IP address numeric host name.
See the getSocketAddressHost().
| [out] | host | target host name string |
|
inlinenoexceptinherited |
Returns socket IP address numeric service name.
See the getSocketAddressService().
| [out] | service | pointer to the service name string |
| length | service name string length (including null terminator) |
|
inlineinherited |
Returns socket IP address numeric service name.
See the getSocketAddressService().
| [out] | service | target service name string |
|
inlinenoexceptinherited |
Returns socket IP address numeric host and service name.
See the getSocketAddressHostService().
| [out] | host | pointer to the host name string |
| hostLength | host name string length (including null terminator) | |
| [out] | service | pointer to the service name string |
| serviceLength | service name string length (including null terminator) |
|
inlineinherited |
Returns socket IP address numeric host and service name.
See the getSocketAddressHostService().
| [out] | host | target host name string |
| [out] | service | target service name string |
|
inlinestaticnoexceptinherited |
Resolves a new socket IP address array. (Blocking call).
See the resolveSocketAddresses().
| [in] | host | socket IP address host name string |
| [in] | service | socket IP address service name string (port) |
| family | socket IP address family type | |
| type | socket communication protocol type | |
| [out] | socketAddresses | reference to the socket address array |
| [out] | addressCount | reference to the socket address count |
|
inlinestaticnoexceptinherited |
Copies source socket IP address to the destination.
See the copySocketAddress().
| sourceAddress | source socket address instance |
| destinationAddress | destination socket address instance |
|
inlinestaticnoexceptinherited |
Compares two socket IP addresses.
See the compareSocketAddress().
| [in] | a | first socket address instance |
| [in] | b | second socket address instance |