MCS  0.3.3-alpha7
mcs::HostInfo Class Reference

Retrieve informations about a network host. More...

#include <mcs.hh>

+ Inheritance diagram for mcs::HostInfo:

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...
 
HostInfooperator= (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
 

Detailed Description

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.

Definition at line 1588 of file mcs.hh.

Constructor & Destructor Documentation

◆ HostInfo() [1/3]

mcs::HostInfo::HostInfo ( const HostInfo )

Declared to avoid using of default copy constructor.

Warning
This constructor is declared but not implemented. If you try to use it you will get a compilation error.

◆ HostInfo() [2/3]

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.

Parameters
hostAddress of the remote host.

Definition at line 177 of file Socket.cc.

◆ HostInfo() [3/3]

mcs::HostInfo::HostInfo ( int  sockfd)

Constructor, to obtain information from an already connected socket.

Parameters
sockfdC socket descriptor.

Definition at line 191 of file Socket.cc.

◆ ~HostInfo()

mcs::HostInfo::~HostInfo ( )

Destructor.

Definition at line 214 of file Socket.cc.

Member Function Documentation

◆ hostname()

string mcs::HostInfo::hostname ( )

Return the host name.

Definition at line 229 of file Socket.cc.

◆ ipaddress()

string mcs::HostInfo::ipaddress ( )

Return the host IP address.

Definition at line 230 of file Socket.cc.

◆ operator=()

HostInfo& mcs::HostInfo::operator= ( const HostInfo )

Declared to avoid using of default assignment operator.

Warning
This operator is declared but not implemented. If you try to use

The documentation for this class was generated from the following files:

mcslogo

MCS (My Customizable Server) ver. 0.3.3-alpha7
Documentation generated on Mon May 28 07:39:41 UTC 2018