Panda3D
Public Member Functions | Static Public Member Functions | Friends | List of all members
Socket_IP Class Reference

Base functionality for a INET domain Socket This call should be the starting point for all other unix domain sockets. More...

#include "socket_ip.h"

Inheritance diagram for Socket_IP:
TypedObject MemoryBase Socket_TCP Socket_TCP_Listen Socket_UDP_Incoming Socket_UDP_Outgoing Buffered_DatagramConnection Socket_UDP

Public Member Functions

 Socket_IP ()
 Def Constructor. More...
 
 Socket_IP (SOCKET in)
 Assigns an existing socket to this class. More...
 
virtual ~Socket_IP ()
 Destructor. More...
 
bool Active ()
 Ask if the socket is open (allocated) More...
 
void Close ()
 Closes a socket if it is open (allocated). More...
 
virtual TypeHandle force_init_type ()
 
virtual TypeHandle get_type () const
 
Socket_Address GetPeerName (void) const
 Wrapper on berkly getpeername... More...
 
SOCKET GetSocket ()
 Gets the base socket type. More...
 
SOCKET GetSocket () const
 Get The RAW file id of the socket. More...
 
int SetBlocking ()
 Set the socket to block on subsequent calls to socket functions that address this socket. More...
 
int SetNonBlocking ()
 this function will throw a socket into non-blocking mode More...
 
int SetRecvBufferSize (int size)
 Ok it sets the recv buffer size for both tcp and UDP. More...
 
bool SetReuseAddress (bool flag=true)
 Informs a socket to reuse IP address as needed. More...
 
void SetSocket (SOCKET ins)
 Assigns an existing socket to this class. More...
 
bool SetV6Only (bool flag)
 Sets a flag indicating whether this IPv6 socket should operate in dual-stack mode or not. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
TypedObjectoperator= (const TypedObject &copy)=default
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static int GetLastError ()
 Gets the last errcode from a socket operation. More...
 
static void init_type ()
 
static int InitNetworkDriver ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 

Friends

class Socket_TCP
 
class Socket_TCP_Listen
 
class Socket_TCP_SSL
 
class Socket_UDP
 
class Socket_UDP_Incoming
 
class Socket_UDP_Outgoing
 

Additional Inherited Members

- Public Attributes inherited from TypedObject
 get_type
 

Detailed Description

Base functionality for a INET domain Socket This call should be the starting point for all other unix domain sockets.

SocketIP | ------------------------------------------------------------------- | | | | SocketTCP SocketTCP_Listen SocketUDP_Incoming SocketUDP_OutBound

Definition at line 27 of file socket_ip.h.

Constructor & Destructor Documentation

◆ Socket_IP() [1/2]

Socket_IP::Socket_IP ( )
inline

Def Constructor.

Definition at line 104 of file socket_ip.h.

◆ Socket_IP() [2/2]

Socket_IP::Socket_IP ( SOCKET  in)
inline

Assigns an existing socket to this class.

Definition at line 112 of file socket_ip.h.

◆ ~Socket_IP()

Socket_IP::~Socket_IP ( )
inlinevirtual

Destructor.

Definition at line 120 of file socket_ip.h.

References Close().

Member Function Documentation

◆ Active()

bool Socket_IP::Active ( )
inline

Ask if the socket is open (allocated)

Definition at line 96 of file socket_ip.h.

Referenced by Close().

◆ Close()

void Socket_IP::Close ( )
inline

◆ GetLastError()

int Socket_IP::GetLastError ( )
inlinestatic

Gets the last errcode from a socket operation.

Definition at line 140 of file socket_ip.h.

Referenced by Buffered_DatagramConnection::Flush().

◆ GetPeerName()

Socket_Address Socket_IP::GetPeerName ( void  ) const
inline

Wrapper on berkly getpeername...

Definition at line 253 of file socket_ip.h.

Referenced by Connection::get_address().

◆ GetSocket() [1/2]

SOCKET Socket_IP::GetSocket ( )
inline

Gets the base socket type.

Definition at line 237 of file socket_ip.h.

Referenced by Socket_fdset::IsSetFor(), and Socket_UDP_Incoming::OpenForInputMCast().

◆ GetSocket() [2/2]

SOCKET Socket_IP::GetSocket ( ) const
inline

Get The RAW file id of the socket.

Definition at line 245 of file socket_ip.h.

◆ SetBlocking()

int Socket_IP::SetBlocking ( )
inline

Set the socket to block on subsequent calls to socket functions that address this socket.

Definition at line 191 of file socket_ip.h.

◆ SetNonBlocking()

int Socket_IP::SetNonBlocking ( )
inline

this function will throw a socket into non-blocking mode

Definition at line 169 of file socket_ip.h.

Referenced by Socket_TCP::ActiveOpenNonBlocking().

◆ SetRecvBufferSize()

int Socket_IP::SetRecvBufferSize ( int  size)
inline

Ok it sets the recv buffer size for both tcp and UDP.

Definition at line 157 of file socket_ip.h.

Referenced by Connection::set_recv_buffer_size().

◆ SetReuseAddress()

bool Socket_IP::SetReuseAddress ( bool  flag = true)
inline

Informs a socket to reuse IP address as needed.

Definition at line 212 of file socket_ip.h.

Referenced by Socket_TCP::ActiveOpenNonBlocking(), Socket_TCP_Listen::OpenForListen(), and Connection::set_reuse_addr().

◆ SetSocket()

void Socket_IP::SetSocket ( SOCKET  ins)
inline

Assigns an existing socket to this class.

Definition at line 148 of file socket_ip.h.

References Close().

◆ SetV6Only()

bool Socket_IP::SetV6Only ( bool  flag)
inline

Sets a flag indicating whether this IPv6 socket should operate in dual-stack mode or not.

Definition at line 225 of file socket_ip.h.


The documentation for this class was generated from the following files: