|
blocxx
|
#include <SocketAddress.hpp>
Public Types | |
| enum | AddressType { UNSET, INET, UDS } |
Public Member Functions | |
| AddressType | getType () const |
| UInt16 | getPort () const |
| Get the port associated with the address. More... | |
| ~SocketAddress () | |
| const String | getName () const |
| Returns the hostname (FQDN) of the address. More... | |
| const String | getAddress () const |
| Returns the IP address of the host. More... | |
| const SocketAddress_t * | getNativeForm () const |
| size_t | getNativeFormSize () const |
| const InetSocketAddress_t * | getInetAddress () const |
| Get a pointer to the InetSocketAddress_t precondition: getType() == INET. More... | |
| const UnixSocketAddress_t * | getUnixAddress () const |
| Get a pointer to the UnixSocketAddress_t precondition: getType() == UDS. More... | |
| void | assignFromNativeForm (const UnixSocketAddress_t *address, size_t len) |
| const String | toString () const |
| Returns the IP address and the port with a colon in between. More... | |
| void | assignFromNativeForm (const InetSocketAddress_t *address, size_t len) |
| SocketAddress () | |
Static Public Member Functions | |
| static SocketAddress | getByName (const String &host, unsigned short port=0) |
| Do a DNS lookup on a hostname and return an SocketAddress for that host. More... | |
| static SocketAddress | getAnyLocalHost (UInt16 port=0) |
| Do a DNS lookup on a hostname and return a list of all addresses that map to that hostname. More... | |
| static SocketAddress | allocEmptyAddress (AddressType type) |
| Allocate an empty SocketAddress. More... | |
| static SocketAddress | getUDS (const String &filename) |
Static Public Attributes | |
| static const char *const | ALL_LOCAL_ADDRESSES = "0.0.0.0" |
Private Member Functions | |
| SocketAddress (const InetSocketAddress_t &nativeForm) | |
| SocketAddress (const UnixSocketAddress_t &nativeForm) | |
Static Private Member Functions | |
| static SocketAddress | getFromNativeForm (const InetAddress_t &nativeForm, UInt16 nativePort, const String &hostname) |
| static SocketAddress | getFromNativeForm (const InetSocketAddress_t &nativeForm) |
| static SocketAddress | getFromNativeForm (const UnixSocketAddress_t &nativeForm) |
Private Attributes | |
| String | m_name |
| String | m_address |
| size_t | m_nativeSize |
| InetSocketAddress_t | m_inetNativeAddress |
| UnixSocketAddress_t | m_UDSNativeAddress |
| AddressType | m_type |
Definition at line 85 of file SocketAddress.hpp.
| Enumerator | |
|---|---|
| UNSET | |
| INET | |
| UDS | |
Definition at line 90 of file SocketAddress.hpp.
|
inline |
Definition at line 133 of file SocketAddress.hpp.
| BLOCXX_NAMESPACE::SocketAddress::SocketAddress | ( | ) |
Definition at line 172 of file SocketAddress.cpp.
Referenced by SocketAddress().
|
private |
Definition at line 431 of file SocketAddress.cpp.
|
private |
Definition at line 423 of file SocketAddress.cpp.
References getFromNativeForm(), INET, and SocketAddress().
|
static |
Allocate an empty SocketAddress.
Definition at line 453 of file SocketAddress.cpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::doListen().
| void BLOCXX_NAMESPACE::SocketAddress::assignFromNativeForm | ( | const InetSocketAddress_t * | address, |
| size_t | len | ||
| ) |
Definition at line 368 of file SocketAddress.cpp.
| void BLOCXX_NAMESPACE::SocketAddress::assignFromNativeForm | ( | const UnixSocketAddress_t * | address, |
| size_t | len | ||
| ) |
Definition at line 391 of file SocketAddress.cpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::fillAddrParms().
| const String BLOCXX_NAMESPACE::SocketAddress::getAddress | ( | ) | const |
Returns the IP address of the host.
Definition at line 443 of file SocketAddress.cpp.
|
static |
Do a DNS lookup on a hostname and return a list of all addresses that map to that hostname.
| host | The hostname |
| port | The port |
| port | The port |
Definition at line 316 of file SocketAddress.cpp.
|
static |
Do a DNS lookup on a hostname and return an SocketAddress for that host.
| host | The hostname |
| port | The port |
| UnknownHostException |
Definition at line 184 of file SocketAddress.cpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::doListenIPv4().
|
staticprivate |
Definition at line 267 of file SocketAddress.cpp.
References m_inetNativeAddress.
Referenced by SocketAddress().
|
staticprivate |
Definition at line 249 of file SocketAddress.cpp.
|
staticprivate |
Definition at line 258 of file SocketAddress.cpp.
References m_UDSNativeAddress.
| const InetSocketAddress_t * BLOCXX_NAMESPACE::SocketAddress::getInetAddress | ( | ) | const |
Get a pointer to the InetSocketAddress_t precondition: getType() == INET.
Definition at line 299 of file SocketAddress.cpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::doListenIPv4().
| const String BLOCXX_NAMESPACE::SocketAddress::getName | ( | ) | const |
Returns the hostname (FQDN) of the address.
Definition at line 438 of file SocketAddress.cpp.
| const SocketAddress_t * BLOCXX_NAMESPACE::SocketAddress::getNativeForm | ( | ) | const |
Definition at line 281 of file SocketAddress.cpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::doListenUDS().
| size_t BLOCXX_NAMESPACE::SocketAddress::getNativeFormSize | ( | ) | const |
Definition at line 448 of file SocketAddress.cpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::doListenUDS().
| UInt16 BLOCXX_NAMESPACE::SocketAddress::getPort | ( | ) | const |
Get the port associated with the address.
Definition at line 403 of file SocketAddress.cpp.
|
inline |
Definition at line 96 of file SocketAddress.hpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::accept(), BLOCXX_NAMESPACE::ServerSocketImpl::close(), and BLOCXX_NAMESPACE::ServerSocketImpl::fillAddrParms().
|
static |
Definition at line 132 of file SocketAddress.cpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::doListenUDS().
| const UnixSocketAddress_t * BLOCXX_NAMESPACE::SocketAddress::getUnixAddress | ( | ) | const |
Get a pointer to the UnixSocketAddress_t precondition: getType() == UDS.
Definition at line 308 of file SocketAddress.cpp.
| const String BLOCXX_NAMESPACE::SocketAddress::toString | ( | ) | const |
Returns the IP address and the port with a colon in between.
Definition at line 476 of file SocketAddress.cpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::close().
|
static |
Definition at line 88 of file SocketAddress.hpp.
Referenced by BLOCXX_NAMESPACE::ServerSocketImpl::doListenIPv4().
|
private |
Definition at line 186 of file SocketAddress.hpp.
|
private |
Definition at line 189 of file SocketAddress.hpp.
Referenced by getFromNativeForm().
|
private |
Definition at line 185 of file SocketAddress.hpp.
|
private |
Definition at line 187 of file SocketAddress.hpp.
|
private |
Definition at line 195 of file SocketAddress.hpp.
|
private |
Definition at line 192 of file SocketAddress.hpp.
Referenced by getFromNativeForm().
1.8.18