mcs::HostInfo Class Reference

#include <mcs.hh>

Inheritance diagram for mcs::HostInfo:

Inheritance graph
[legend]

List of all members.


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 1622 of file mcs.hh.


Public Member Functions

 HostInfo (int sockfd)
 Constructor, to obtain information from an already connected socket.
 HostInfo (string host)
 Constructor.
 HostInfo (const HostInfo &)
 Declared to avoid using of default copy constructor.
string hostname ()
 Return the host name.
string ipaddress ()
 Return the host IP address.
HostInfooperator= (const HostInfo &)
 Declared to avoid using of default assignment operator.
 ~HostInfo ()
 Destructor.

Protected Member Functions

void populate_sockaddr_in ()

Protected Attributes

string host
string ipaddr
struct sockaddr_in sin

Constructor & Destructor Documentation

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.

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:
host Address of the remote host.

Definition at line 177 of file Socket.cc.

mcs::HostInfo::HostInfo ( int  sockfd  ) 

Constructor, to obtain information from an already connected socket.

Parameters:
sockfd C socket descriptor.

Definition at line 191 of file Socket.cc.

mcs::HostInfo::~HostInfo (  ) 

Destructor.

Definition at line 214 of file Socket.cc.


Member Function Documentation

string mcs::HostInfo::hostname (  ) 

Return the host name.

Definition at line 229 of file Socket.cc.

string mcs::HostInfo::ipaddress (  ) 

Return the host IP address.

Definition at line 230 of file Socket.cc.

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-alpha3
Documentation generated on Thu Mar 22 13:22:23 UTC 2012