50 return _addr.
set_host(
"127.0.0.1", port);
66 set_host(
const std::string &hostname,
int port) {
67 return _addr.
set_host(hostname, port);
127 nassertr(n >= 0 && n < 4, 0);
129 const uint8_t *ip = (
const uint8_t *)&ip_long;
146 output(std::ostream &out)
const {
163 return _addr == other._addr;
171 return _addr != other._addr;
unsigned long GetIPAddressRaw() const
Returns a raw 32-bit unsigned integer representing the IPv4 address.
bool is_any() const
True if the address is zero.
bool set_port(unsigned short port)
Set to a specified port.
bool set_any(int port)
Sets the address up to refer to a particular port, but not to any particular IP.
std::string get_ip_string() const
Returns the IP address to which this address refers, formatted as a string.
bool set_broadcast(int port)
Sets the address to the broadcast address.
bool set_any_IP(unsigned short port)
Set to any address and a specified port.
std::string get_ip_port() const
Return the ip address/port in dot notation string.
void set_port(int port)
Resets the port number without otherwise changing the address.
int get_port() const
Returns the port number to which this address refers.
void clear()
Resets the NetAddress to its initial state.
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(unsigned short port)
Set to the broadcast address and a specified port.
NetAddress()
Constructs an unspecified address.
bool is_any() const
Returns true if the IP address has only zeroes.
unsigned short get_port() const
Get the port portion as an integer.
bool set_host(const std::string &hostname, int port)
Sets the address up to refer to a particular port on a particular host.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool set_localhost(int port)
Sets the address up to refer to a particular port, on this host.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void clear()
Set the internal values to a suitable known value.
A simple place to store and manipulate tcp and port address for communication layer.
std::string get_ip() const
Return the IP address portion in dot notation string.
bool set_host(const std::string &hostname, unsigned short port)
This function will take a port and string-based TCP address and initialize the address with this info...
const Socket_Address & get_addr() const
Returns the Socket_Address for this address.
Represents a network address to which UDP packets may be sent or to which a TCP socket may be bound.