# NetAddress

from pandac.PandaModules import NetAddress

## Inheritance:

NetAddress:

## Methods of NetAddress:

NetAddress (Constructor)
clear
getAddr
getIp
getIpComponent
getIpString
getPort
output
setAny
setHost
setLocalhost
setPort

NetAddress NetAddress::NetAddress(void); Description: Constructs an unspecified address. Description: Constructs an address from a given Socket_Address. Normally, this constructor should not be used by user code; instead, create a default NetAddress and use one of the set_*() functions to set up an address.

clear void NetAddress::clear(void); Description: Resets the NetAddress to its initial state.

getAddr Socket_Address const &NetAddress::get_addr(void) const; Description: Returns the Socket_Address for this address.

getIp unsigned int NetAddress::get_ip(void) const; Description: Returns the IP address to which this address refers, as a 32-bit integer, in host byte order.

getIpComponent unsigned char NetAddress::get_ip_component(int n) const; Description: Returns the nth 8-bit component of the IP address. An IP address has four components; component 0 is the first (leftmost), and component 3 is the last (rightmost) in the dotted number convention.

getIpString string NetAddress::get_ip_string(void) const; Description: Returns the IP address to which this address refers, formatted as a string.

getPort int NetAddress::get_port(void) const; Description: Returns the port number to which this address refers.

output void NetAddress::output(ostream &out) const; Description:

setAny bool NetAddress::set_any(int port); Description: Sets the address up to refer to a particular port, but not to any particular IP. Returns true if successful, false otherwise (currently, this only returns true).

setHost bool NetAddress::set_host(string const &hostname, int port); Description: Sets the address up to refer to a particular port on a particular host. Returns true if the hostname is known, false otherwise.

setLocalhost bool NetAddress::set_localhost(int port); Description: Sets the address up to refer to a particular port, on this host.

setPort void NetAddress::set_port(int port); Description: Resets the port number without otherwise changing the address.