Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Socket address. More...
#include <socket_addr.h>
Public Types | |
enum | { MaxStrLen = 196 } |
Public Member Functions | |
SocketAddr () | |
Construct empty address. More... | |
void | clear () |
Clear address. More... | |
bool | has_host_port () const |
Check whether host and port are set. More... | |
ROC_ATTR_NODISCARD bool | set_host_port (AddrFamily type, const char *host, int port) |
Set host address. More... | |
ROC_ATTR_NODISCARD bool | set_host_port_auto (const char *host, int port) |
Set host address, auto-detect family. More... | |
ROC_ATTR_NODISCARD bool | set_host_port_saddr (const sockaddr *sa) |
Set address from sockaddr struct. More... | |
AddrFamily | family () const |
Get IP version (IPv4 or IPv6). More... | |
bool | multicast () const |
Check whether this is multicast address. More... | |
ROC_ATTR_NODISCARD bool | get_host (char *buf, size_t bufsz) const |
Get host IP address. More... | |
int | port () const |
Get address port. More... | |
sockaddr * | saddr () |
Get sockaddr struct. More... | |
const sockaddr * | saddr () const |
Get sockaddr struct. More... | |
socklen_t | slen () const |
Get sockaddr struct length. More... | |
socklen_t | max_slen () const |
Get maximum allowed sockaddr struct length. More... | |
operator const struct unspecified_bool * () const | |
Convert to bool. More... | |
bool | operator== (const SocketAddr &other) const |
Compare addresses. More... | |
bool | operator!= (const SocketAddr &other) const |
Compare addresses. More... | |
Socket address.
Definition at line 26 of file socket_addr.h.
roc::address::SocketAddr::SocketAddr | ( | ) |
Construct empty address.
void roc::address::SocketAddr::clear | ( | ) |
Clear address.
AddrFamily roc::address::SocketAddr::family | ( | ) | const |
Get IP version (IPv4 or IPv6).
ROC_ATTR_NODISCARD bool roc::address::SocketAddr::get_host | ( | char * | buf, |
size_t | bufsz | ||
) | const |
Get host IP address.
bool roc::address::SocketAddr::has_host_port | ( | ) | const |
Check whether host and port are set.
socklen_t roc::address::SocketAddr::max_slen | ( | ) | const |
Get maximum allowed sockaddr struct length.
bool roc::address::SocketAddr::multicast | ( | ) | const |
Check whether this is multicast address.
roc::address::SocketAddr::operator const struct unspecified_bool * | ( | ) | const |
Convert to bool.
bool roc::address::SocketAddr::operator!= | ( | const SocketAddr & | other | ) | const |
Compare addresses.
bool roc::address::SocketAddr::operator== | ( | const SocketAddr & | other | ) | const |
Compare addresses.
int roc::address::SocketAddr::port | ( | ) | const |
Get address port.
sockaddr* roc::address::SocketAddr::saddr | ( | ) |
Get sockaddr struct.
const sockaddr* roc::address::SocketAddr::saddr | ( | ) | const |
Get sockaddr struct.
ROC_ATTR_NODISCARD bool roc::address::SocketAddr::set_host_port | ( | AddrFamily | type, |
const char * | host, | ||
int | port | ||
) |
Set host address.
ROC_ATTR_NODISCARD bool roc::address::SocketAddr::set_host_port_auto | ( | const char * | host, |
int | port | ||
) |
Set host address, auto-detect family.
ROC_ATTR_NODISCARD bool roc::address::SocketAddr::set_host_port_saddr | ( | const sockaddr * | sa | ) |
Set address from sockaddr struct.
socklen_t roc::address::SocketAddr::slen | ( | ) | const |
Get sockaddr struct length.