# NetAddress

from pandac.PandaModules import NetAddress

Class : NetAddress
Description : Represents a network address to which UDP packets may be sent or to which a TCP socket may be bound.

## Inheritance:

NetAddress:

## Methods of NetAddress:

clear
getAddr
getIp
getIpComponent
getIpString
getPort
output
setAny
setHost
setLocalhost
setPort

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

getAddr PRNetAddr *NetAddress::get_addr(void) const; Description: Returns the PRNetAddr 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.