Panda3D
Public Types | Public Member Functions
Socket_Address Class Reference

A simple place to store and munipulate tcp and port address for communication layer. More...

#include "socket_address.h"

List of all members.

Public Types

typedef struct sockaddr_in AddressType

Public Member Functions

 Socket_Address (const AddressType &inaddr)
 Socket_Address (short port=0)
 Constructor that lets us set a port value.
 Socket_Address (const Socket_Address &inaddr)
 Copy Constructor.
virtual ~Socket_Address ()
 Normal Destructor.
void clear ()
 Set the internal values to a suitable known value.
std::string get_ip () const
 Return the ip address portion in dot notation string.
std::string get_ip_port () const
 Return the ip address/port in dot notation string.
unsigned short get_port () const
 Get the port portion as an integer.
AddressType & GetAddressInfo ()
const AddressType & GetAddressInfo () const
unsigned long GetIPAddressRaw () const
 Return a RAW sockaddr_in.
bool isMcastRange ()
 return true if the address is in the mcast range.
bool operator< (const Socket_Address &in) const
bool operator== (const Socket_Address &in) const
 Allow for normal == operation on a address item.
bool set_any_IP (int port)
 Set to any address and a specified port.
bool set_broadcast (int port)
 Set to the broadcast address and a specified port.
bool set_host (const std::string &hostname, int port)
 this function will take a port and string-based tcp address and initialize the address with the information
bool set_host (const std::string &hostname)
bool set_host (unsigned int ip4adr, int port)
bool set_port (int port)
 Set to a specified port.

Detailed Description

A simple place to store and munipulate tcp and port address for communication layer.

Definition at line 15 of file socket_address.h.


Constructor & Destructor Documentation

Socket_Address::Socket_Address ( short  port = 0) [inline]

Constructor that lets us set a port value.

Definition at line 67 of file socket_address.h.

Socket_Address::Socket_Address ( const Socket_Address inaddr) [inline]

Copy Constructor.

Definition at line 78 of file socket_address.h.

Socket_Address::~Socket_Address ( ) [inline, virtual]

Normal Destructor.

Definition at line 96 of file socket_address.h.


Member Function Documentation

void Socket_Address::clear ( ) [inline]

Set the internal values to a suitable known value.

Definition at line 150 of file socket_address.h.

Referenced by NetAddress::clear().

std::string Socket_Address::get_ip ( ) const [inline]

Return the ip address portion in dot notation string.

Definition at line 170 of file socket_address.h.

Referenced by NetAddress::get_ip_string().

std::string Socket_Address::get_ip_port ( ) const [inline]

Return the ip address/port in dot notation string.

Definition at line 179 of file socket_address.h.

References get_port().

unsigned short Socket_Address::get_port ( ) const [inline]

Get the port portion as an integer.

Definition at line 161 of file socket_address.h.

Referenced by get_ip_port(), NetAddress::get_port(), and Socket_UDP_Incoming::OpenForInputMCast().

unsigned long Socket_Address::GetIPAddressRaw ( ) const [inline]

Return a RAW sockaddr_in.

Definition at line 58 of file socket_address.h.

Referenced by NetAddress::get_ip(), and NetAddress::get_ip_component().

bool Socket_Address::isMcastRange ( void  ) [inline]

return true if the address is in the mcast range.

Definition at line 278 of file socket_address.h.

bool Socket_Address::operator== ( const Socket_Address in) const [inline]

Allow for normal == operation on a address item.

Will simplify the use in sorted containers..

Definition at line 104 of file socket_address.h.

bool Socket_Address::set_any_IP ( int  port) [inline]

Set to any address and a specified port.

Definition at line 128 of file socket_address.h.

Referenced by NetAddress::set_any().

bool Socket_Address::set_broadcast ( int  port) [inline]

Set to the broadcast address and a specified port.

Definition at line 116 of file socket_address.h.

Referenced by set_host().

bool Socket_Address::set_host ( const std::string &  hostname,
int  port 
) [inline]

this function will take a port and string-based tcp address and initialize the address with the information

Return type : bool (address is undefined after an error)

Definition at line 193 of file socket_address.h.

References set_broadcast().

Referenced by NetAddress::set_host(), and NetAddress::set_localhost().

bool Socket_Address::set_port ( int  port) [inline]

Set to a specified port.

Definition at line 140 of file socket_address.h.

Referenced by NetAddress::set_port().


The documentation for this class was generated from the following file:
 All Classes Functions Variables Enumerations