Panda3D
Public Member Functions | List of all members
SocketAddress Class Reference

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

Public Member Functions

 __init__ (const SocketAddress inaddr)
 
 __init__ (unsigned short int port)
 Constructor that lets us set a port value. More...
 
 clear ()
 Set the internal values to a suitable known value. More...
 
str getIp ()
 Return the IP address portion in dot notation string. More...
 
unsigned long int GetIPAddressRaw ()
 Return a RAW sockaddr_in. More...
 
str getIpPort ()
 Return the ip address/port in dot notation string. More...
 
unsigned short int getPort ()
 Get the port portion as an integer. More...
 
bool isMcastRange ()
 True if the address is in the multicast range. More...
 
bool operator!= (const SocketAddress in)
 
bool operator< (const SocketAddress in)
 
bool operator== (const SocketAddress in)
 
bool setAnyIP (int port)
 Set to any address and a specified port. More...
 
bool setBroadcast (int port)
 Set to the broadcast address and a specified port. More...
 
bool setHost (str hostname)
 
bool setHost (str hostname, int port)
 This function will take a port and string-based TCP address and initialize the address with this information. Returns true on success; on failure, it returns false and the address may be undefined. More...
 
bool setHost (unsigned int ip4adr, int port)
 
bool setPort (int port)
 Set to a specified port. More...
 

Detailed Description

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

Member Function Documentation

◆ __init__() [1/2]

__init__ ( const SocketAddress  inaddr)

◆ __init__() [2/2]

__init__ ( unsigned short int  port)

Constructor that lets us set a port value.

◆ clear()

clear ( )

Set the internal values to a suitable known value.

◆ getIp()

str getIp ( )

Return the IP address portion in dot notation string.

◆ GetIPAddressRaw()

unsigned long int GetIPAddressRaw ( )

Return a RAW sockaddr_in.

◆ getIpPort()

str getIpPort ( )

Return the ip address/port in dot notation string.

◆ getPort()

unsigned short int getPort ( )

Get the port portion as an integer.

◆ isMcastRange()

bool isMcastRange ( )

True if the address is in the multicast range.

◆ operator!=()

bool operator!= ( const SocketAddress  in)

◆ operator<()

bool operator< ( const SocketAddress  in)

◆ operator==()

bool operator== ( const SocketAddress  in)

◆ setAnyIP()

bool setAnyIP ( int  port)

Set to any address and a specified port.

◆ setBroadcast()

bool setBroadcast ( int  port)

Set to the broadcast address and a specified port.

◆ setHost() [1/3]

bool setHost ( str  hostname)

◆ setHost() [2/3]

bool setHost ( str  hostname,
int  port 
)

This function will take a port and string-based TCP address and initialize the address with this information. Returns true on success; on failure, it returns false and the address may be undefined.

◆ setHost() [3/3]

bool setHost ( unsigned int  ip4adr,
int  port 
)

◆ setPort()

bool setPort ( int  port)

Set to a specified port.