|
libBsdSockets
C++ Wrapper classes to the BSD Socket API
|
Internet Address Class supporting IPv4 and IPv6 and creatable from hostnames and service names. More...
#include <InetAddress.h>


Public Types | |
| typedef std::shared_ptr< InetAddress > | Ptr |
Public Types inherited from BsdSockets::Address | |
| typedef std::shared_ptr< Address > | Ptr |
Public Member Functions | |
| virtual | ~InetAddress () |
| const std::string & | getRequestedAddress () const |
| const std::string & | getActualAddress () const |
| const std::string & | getServiceName () const |
| const unsigned int | getPort () const |
| virtual std::shared_ptr< LowLevelAddress > | makeTempLowLevelAddress () const |
| virtual Address::Ptr | create (std::shared_ptr< LowLevelAddress > lowLevelAddress) const |
| virtual LowLevelAddress & | getLowLevelAddress () const |
Public Member Functions inherited from BsdSockets::Address | |
| virtual | ~Address () |
| SocketDomain | getSocketDomain () const |
| SocketType | getSocketType () const |
| int | getProtocol () const |
Static Public Member Functions | |
| static int | create (SocketType socketType, const std::string &serviceName, const std::string &address, std::vector< InetAddress::Ptr > &created, unsigned int max=0) |
| static InetAddress::Ptr | create (SocketType socketType, const std::string &serviceName, const std::string &address="") |
Additional Inherited Members | |
Protected Member Functions inherited from BsdSockets::Address | |
| Address (SocketDomain theSocketDomain, SocketType theSocketType, int theProtocol) | |
| Address (const Address &rhs) | |
Internet Address Class supporting IPv4 and IPv6 and creatable from hostnames and service names.
Most users will create addresses with a hostname and either a service name or port number. This supports that with ease. Additionally, create() can accept a std::vector<InetAddress> to put all matching Addresses into. For example, some hostnames are served by multiple IP addresses to load balance. The caller can use create() to either return the first match or populate a std::vector<InetAddress> with all matches.
Definition at line 41 of file InetAddress.h.
| typedef std::shared_ptr<InetAddress> BsdSockets::InetAddress::Ptr |
Definition at line 43 of file InetAddress.h.
|
virtual |
Virtual destructor to support derived classes
Definition at line 169 of file InetAddress.cpp.
|
static |
Create an address with the given parameters putting all matches into created.
| socketType | the SocketType of the Address | |
| serviceName | name of standard service or port number desired, may be empty if address is not | |
| address | desired, may be empty if serviceName is not empty | |
| [out] | created | the container to add created Addresses to |
| max | the limit on the count of Addresses to match, 0 means unlimited matches |
Definition at line 116 of file InetAddress.cpp.
|
static |
Create one address with the given parameters.
This is a convenience method equivalent to:
| socketType | the SocketType of the Address |
| serviceName | name of standard service or port number desired, may be empty if address is not |
| address | desired, may be empty if serviceName is not empty |
Definition at line 162 of file InetAddress.cpp.
|
virtual |
Create a new Address from a LowLevelAddress using this Address as a template.
| lowLevelAddress | data to create from |
Implements BsdSockets::Address.
Definition at line 206 of file InetAddress.cpp.
| const std::string & BsdSockets::InetAddress::getActualAddress | ( | ) | const |
Definition at line 190 of file InetAddress.cpp.
|
virtual |
Method for derived classes to provide access to the LowLevelAddress information
Implements BsdSockets::Address.
Definition at line 221 of file InetAddress.cpp.
| const unsigned int BsdSockets::InetAddress::getPort | ( | ) | const |
Definition at line 198 of file InetAddress.cpp.
| const std::string & BsdSockets::InetAddress::getRequestedAddress | ( | ) | const |
Definition at line 186 of file InetAddress.cpp.
| const std::string & BsdSockets::InetAddress::getServiceName | ( | ) | const |
Definition at line 194 of file InetAddress.cpp.
|
virtual |
Implements BsdSockets::Address.
Definition at line 202 of file InetAddress.cpp.