33 bool set_host(
const std::string &hostname,
int port);
46 void output(std::ostream &out)
const;
48 size_t get_hash()
const;
49 bool operator == (
const NetAddress &other)
const;
50 bool operator != (
const NetAddress &other)
const;
56INLINE std::ostream &operator << (std::ostream &out,
const NetAddress &addr) {
Represents a network address to which UDP packets may be sent or to which a TCP socket may be bound.
void clear()
Resets the NetAddress to its initial state.
bool set_host(const std::string &hostname, int port)
Sets the address up to refer to a particular port on a particular host.
bool set_localhost(int port)
Sets the address up to refer to a particular port, on this host.
std::string get_ip_string() const
Returns the IP address to which this address refers, formatted as a string.
int get_port() const
Returns the port number to which this address refers.
bool set_any(int port)
Sets the address up to refer to a particular port, but not to any particular IP.
const Socket_Address & get_addr() const
Returns the Socket_Address for this address.
bool is_any() const
Returns true if the IP address has only zeroes.
uint8_t get_ip_component(int n) const
Returns the nth 8-bit component of the IP address.
uint32_t get_ip() const
Returns the IP address to which this address refers, as a 32-bit integer, in host byte order.
bool set_broadcast(int port)
Sets the address to the broadcast address.
NetAddress()
Constructs an unspecified address.
void set_port(int port)
Resets the port number without otherwise changing the address.
A simple place to store and manipulate tcp and port address for communication layer.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.