Panda3D
|
Represents a network address to which UDP packets may be sent or to which a TCP socket may be bound. More...
#include <pandadoc.hpp>
Public Member Functions | |
__init__ () | |
Constructs an unspecified address. | |
__init__ (const NetAddress) | |
__init__ (const SocketAddress addr) | |
Constructs an address from a given Socket_Address. | |
clear () | |
Resets the NetAddress to its initial state. | |
const SocketAddress | getAddr () |
Returns the Socket_Address for this address. | |
int | getHash () |
uint32_t | getIp () |
Returns the IP address to which this address refers, as a 32-bit integer, in host byte order. | |
uint8_t | getIpComponent (int n) |
Returns the nth 8-bit component of the IP address. | |
str | 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. | |
bool | isAny () |
Returns true if the IP address has only zeroes. | |
bool | operator!= (const NetAddress other) |
bool | operator== (const NetAddress other) |
output (Ostream out) | |
bool | setAny (int port) |
Sets the address up to refer to a particular port, but not to any particular IP. | |
bool | setBroadcast (int port) |
Sets the address to the broadcast address. | |
bool | setHost (str 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. | |
Represents a network address to which UDP packets may be sent or to which a TCP socket may be bound.
__init__ | ( | ) |
Constructs an unspecified address.
__init__ | ( | const NetAddress | ) |
__init__ | ( | const SocketAddress | 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.
clear | ( | ) |
Resets the NetAddress to its initial state.
const SocketAddress getAddr | ( | ) |
Returns the Socket_Address for this address.
int getHash | ( | ) |
uint32_t getIp | ( | ) |
Returns the IP address to which this address refers, as a 32-bit integer, in host byte order.
uint8_t 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.
str 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.
bool isAny | ( | ) |
Returns true if the IP address has only zeroes.
bool operator!= | ( | const NetAddress | other | ) |
bool operator== | ( | const NetAddress | other | ) |
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 setBroadcast | ( | int | port | ) |
Sets the address to the broadcast address.
bool setHost | ( | str | 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.