class InetAddress

Internet Address binary data type. More...

Definition#include <socket.h>
Inherited byInetHostAddress, InetMaskAddress, BroadcastAddress
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Members

Protected Members


Detailed Description

binary encoded internet host addresses are held in this special class object. This class represents the 'generic' internet address data type. Other InetAddress derived objects hold addresses which are used only for specific purposes, such as for network masks, broadcast addresses, etc.

InetAddress ()

Create an Internet Address object with an empty (0.0.0.0) address.

InetAddress (struct in_addr)

Convert the system internet address data type (struct in_addr) into a Common C++ InetAddress object.

Parameters:
addrstruct of system used binary internet address.

InetAddress (const char *address)

Convert a null terminated ASCII host address string (example: "127.0.0.1") directly into a Common C++ InetAddress object.

Parameters:
addressnull terminated C string.

char * getHostname (void)

Provide a string representation of the value (Internet Address) held in the InetAddress object.

Returns: string representation of InetAddress.

bool isInetAddress (void)

May be used to verify if a given InetAddress returned by another function contains a "valid" address, or "0.0.0.0" which is often used to mark "invalid" InetAddress values.

Returns: true if address != 0.0.0.0.

inline struct in_addr getAddress (void)

Provide a low level system usable struct in_addr object from the contents of InetAddress. This is needed for services such as bind() and connect().

Returns: system binary coded internet address.

bool operator== (InetAddress &a)

Compare two internet addresses to see if they are equal (if they specify the physical address of the same internet host).

bool operator!= (InetAddress &a)

Compare two internet addresses to see if they are not equal (if they each refer to unique and different physical ip addresses).