MCS
0.3.3-alpha7
|
Retrieve informations about a network host. More...
#include <mcs.hh>
Public Member Functions | |
HostInfo (const HostInfo &) | |
Declared to avoid using of default copy constructor. More... | |
HostInfo (string host) | |
Constructor. More... | |
HostInfo (int sockfd) | |
Constructor, to obtain information from an already connected socket. More... | |
string | hostname () |
Return the host name. More... | |
string | ipaddress () |
Return the host IP address. More... | |
HostInfo & | operator= (const HostInfo &) |
Declared to avoid using of default assignment operator. More... | |
~HostInfo () | |
Destructor. More... | |
Protected Member Functions | |
void | populate_sockaddr_in () |
Protected Attributes | |
string | host |
string | ipaddr |
struct sockaddr_in | sin |
Retrieve informations about a network host.
This class can be used to obtain informations such as the host name or the IP address for a network host. It is used by the Socket to obtain a "struct sockaddr_in" needed to connect to a remote host.
mcs::HostInfo::HostInfo | ( | const HostInfo & | ) |
Declared to avoid using of default copy constructor.
mcs::HostInfo::HostInfo | ( | string | host | ) |
Constructor.
This constructor create a HostInfo object with informations about the host address given as parameter. The host address can be either an IP address or a valid alias if there is a working DNS in the system.
host | Address of the remote host. |
mcs::HostInfo::HostInfo | ( | int | sockfd | ) |
string mcs::HostInfo::ipaddress | ( | ) |
Declared to avoid using of default assignment operator.
![]() |
MCS (My Customizable Server) ver. 0.3.3-alpha7
|