29#include <sptk5/sptk.h>
34#include <netinet/in.h>
35#include <sptk5/Strings.h>
36#include <sys/socket.h>
45using SOCKET_ADDRESS_FAMILY = sa_family_t;
54#define INVALID_SOCKET -1
61using SOCKET_ADDRESS_FAMILY =
unsigned short;
117 return &m_address.generic;
126 return addressLength(m_address.generic);
145 if (address.sa_family == AF_INET)
146 return sizeof(sockaddr_in);
147 return sizeof(sockaddr_in6);
IPv4 and IPv6 address presentation.
Definition: IPAddress.h:75
const String & toString() const
Definition: IPAddress.h:133
static size_t addressLength(const sockaddr &address)
Definition: IPAddress.h:143
IPAddress(const IPAddress &other)
Copy constructor.
const sockaddr * address() const
Get address data.
Definition: IPAddress.h:115
IPAddress & operator=(const IPAddress &other)
Assignment.
IPAddress(const sockaddr &address)
Constructor.
IPAddress()
Default constructor.
size_t length() const
Definition: IPAddress.h:124