ClanSoft logo
ClanSoft logo
Entire Class Index Main Class Index Cross Index Global Index

Class CL_IPAddress

Socket name; container class for an IP address and port.
Contained in: global
Derived from: none
Derived by: none
Group: Network (Sockets)

#include <ClanLib/network.h>


public function member index:

Construction:

CL_IPAddress();
CL_IPAddress(const std::string& port);
CL_IPAddress(const std::string& hostname, const std::string& port);
CL_IPAddress(const CL_IPAddress& copy);

Attributes:

void get_addrinfo(int type, struct sockaddr& addr, int& len) const;
std::string get_address() const;
std::string get_port() const;
bool operator == (const CL_IPAddress& other_instance) const;
bool operator < (const CL_IPAddress& other_instance) const;
bool operator > (const CL_IPAddress& other_instance) const;

Operations:

void set_address(const std::string& hostname);
void set_address(const std::string& hostname, const std::string& port);
void set_port(const std::string& port);
std::string dns_lookup() const;
 

Description:


Function Member Descriptions:

CL_IPAddress::CL_IPAddress - Constructs an IP address using INADDR_ANY and port 0.
CL_IPAddress();


CL_IPAddress::CL_IPAddress - Constructs an IP address using INADDR_ANY and the specified port.
CL_IPAddress(const std::string& port);


CL_IPAddress::CL_IPAddress - Construct an IP address using the hostname and the port.
CL_IPAddress(const std::string& hostname, const std::string& port);


CL_IPAddress::CL_IPAddress - Copy constructor.
CL_IPAddress(const CL_IPAddress& copy);


CL_IPAddress::dns_lookup - Do a DNS lookup on the IP address.
std::string dns_lookup() const;


CL_IPAddress::get_address - Returns the IP address as a string.
std::string get_address() const;


CL_IPAddress::get_addrinfo - Returns the internal addrinfo struct
void get_addrinfo(int type, struct sockaddr& addr, int& len) const;


CL_IPAddress::get_port - Returns the IP port as a string.
std::string get_port() const;


CL_IPAddress::operator < - Returns true if the other address is less.
bool operator < (const CL_IPAddress& other_instance) const;
<p>This is used for sorting
purposes (eg. if you use a std::map<CL_IPAddress, CL_Socket>), and sorts
the address based on lowest IP number address.</p>



CL_IPAddress::operator == - Returns true if objects are the same.
bool operator == (const CL_IPAddress& other_instance) const;


CL_IPAddress::operator > - Returns true if the other address is greater.
bool operator > (const CL_IPAddress& other_instance) const;
<p>This is used for sorting
purposes (eg. if you use a std::map<CL_IPAddress, CL_Socket>), and sorts
the address based on lowest IP number address.</p>



CL_IPAddress::set_address - Set the IP address using a hostname.
void set_address(const std::string& hostname);


CL_IPAddress::set_address - Set the IP address using a hostname and port.
void set_address(const std::string& hostname, const std::string& port);


CL_IPAddress::set_port - Set the IP port.
void set_port(const std::string& port);



Variable Member Descriptions: