Support Forum       G3D Web Page     
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
G3D::NetAddress Class Reference

Public Types

enum  { DEFAULT_ADAPTER_HOST = 0 }
 

Public Member Functions

 NetAddress (uint32 host, uint16 port=0)
 
In host byte order. More...
 
 NetAddress (const String &hostname, uint16 port)
 
More...
 
 NetAddress (const String &hostnameAndPort)
 
 NetAddress ()
 
void deserialize (class BinaryInput &b)
 
String hostname () const
 Name of this address, without the domain. More...
 
uint32 ip () const
 Returns a value in host format (i.e., don't worry about endian issues) More...
 
String ipString () const
 
bool ok () const
 Returns true if this is not an illegal address. More...
 
uint16 port () const
 
void serialize (class BinaryOutput &b) const
 
String toString () const
 

Static Public Member Functions

static NetAddress broadcastAddress (uint16 port)
 
Creates a UDP broadcast address for use with a G3D::LightweightConduit. More...
 
static void localHostAddresses (Array< NetAddress > &array)
 
static String localHostname ()
 Name of the local machine machine, without the domain. More...
 

Friends

class LightweightConduit
 
class NetworkDevice
 
class ReliableConduit
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DEFAULT_ADAPTER_HOST 

Use the host portion of the IP address of the default adapter on this machine.

Constructor & Destructor Documentation

◆ NetAddress() [1/4]

G3D::NetAddress::NetAddress ( uint32  host,
uint16  port = 0 
)
explicit


In host byte order.

See also
DEFAULT_ADAPTER_HOST

◆ NetAddress() [2/4]

G3D::NetAddress::NetAddress ( const String hostname,
uint16  port 
)


Parameters
portSpecified in host byte order (i.e., don't worry about endian issues)

◆ NetAddress() [3/4]

G3D::NetAddress::NetAddress ( const String hostnameAndPort)
explicit
Parameters
hostnameAndPortin the form "hostname:port" or "ip:port"

◆ NetAddress() [4/4]

G3D::NetAddress::NetAddress ( )

Member Function Documentation

◆ broadcastAddress()

static NetAddress G3D::NetAddress::broadcastAddress ( uint16  port)
static


Creates a UDP broadcast address for use with a G3D::LightweightConduit.

Deprecated:
Use G3D::NetworkDevice::broadcastAddressArray()

UDP broadcast allows one machine to send a packet to all machines on the same local network. The IP portion of the address is 0xFFFFFFFF, which indicates "broadcast" to the underlying socket API. This feature is not available with the connection-based TCP protocol abstracted by G3D::ReliableConduit; use multisend instead.

◆ deserialize()

void G3D::NetAddress::deserialize ( class BinaryInput b)

◆ hostname()

String G3D::NetAddress::hostname ( ) const

Name of this address, without the domain.

Performs reverse DNS lookup on this address. This may make a network connection to a DNS server and block until that communication completes if the address is one that has not been recently checked.

◆ ip()

uint32 G3D::NetAddress::ip ( ) const
inline

Returns a value in host format (i.e., don't worry about endian issues)

Referenced by HashTrait< G3D::NetAddress >::hashCode(), and G3D::operator==().

◆ ipString()

String G3D::NetAddress::ipString ( ) const

◆ localHostAddresses()

static void G3D::NetAddress::localHostAddresses ( Array< NetAddress > &  array)
static

◆ localHostname()

static String G3D::NetAddress::localHostname ( )
static

Name of the local machine machine, without the domain.

The value is cached after the first call.

Referenced by G3D::NetServer::create().

◆ ok()

bool G3D::NetAddress::ok ( ) const

Returns true if this is not an illegal address.

◆ port()

uint16 G3D::NetAddress::port ( ) const
inline

◆ serialize()

void G3D::NetAddress::serialize ( class BinaryOutput b) const

◆ toString()

String G3D::NetAddress::toString ( ) const

Friends And Related Function Documentation

◆ LightweightConduit

friend class LightweightConduit
friend

◆ NetworkDevice

friend class NetworkDevice
friend

◆ ReliableConduit

friend class ReliableConduit
friend

documentation generated on Wed Nov 24 2021 08:01:58 using doxygen 1.8.15