Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# NetAddress Class Reference

List of all members.

## Public Member Functions
| NetAddress ()
| Constructs an unspecified address.
| NetAddress (Socket_Address const addr)
| Constructs an address from a given Socket_Address.
| clear ()
| Resets the NetAddress to its initial state.
Socket_Address const | getAddr ()
| Returns the Socket_Address for this address.
unsigned int | getIp ()
| Returns the IP address to which this address refers, as a 32-bit integer, in host byte order.
unsigned char | getIpComponent (int n)
| Returns the nth 8-bit component of the IP address.
string | getIpString ()
| Returns the IP address to which this address refers, formatted as a string.
int | getPort ()
| Returns the port number to which this address refers.
| output (ostream out)
bool | setAny (int port)
| Sets the address up to refer to a particular port, but not to any particular IP.
bool | setHost (string hostname, int port)
| Sets the address up to refer to a particular port on a particular host.
bool | setLocalhost (int port)
| Sets the address up to refer to a particular port, on this host.
| setPort (int port)
| Resets the port number without otherwise changing the address.

## Constructor & Destructor Documentation

NetAddress | ( |  | ) |

Constructs an unspecified address.

NetAddress | ( | Socket_Address const | addr | ) |

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.

## Member Function Documentation

clear | ( |  | ) |

Resets the NetAddress to its initial state.

Socket_Address const getAddr | ( |  | ) |

Returns the Socket_Address for this address.

unsigned int getIp | ( |  | ) |

Returns the IP address to which this address refers, as a 32-bit integer, in host byte order.

unsigned char getIpComponent | ( | int | n | ) |

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.

string getIpString | ( |  | ) |

Returns the IP address to which this address refers, formatted as a string.

int getPort | ( |  | ) |

Returns the port number to which this address refers.

output | ( | ostream | out | ) |

bool setAny | ( | int | port | ) |

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).

bool setHost | ( | string | hostname,
|  | int | port
| ) |  |

Sets the address up to refer to a particular port on a particular host.

Returns true if the hostname is known, false otherwise.

bool setLocalhost | ( | int | port | ) |

Sets the address up to refer to a particular port, on this host.

setPort | ( | int | port | ) |

Resets the port number without otherwise changing the address.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties