Panda3D
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
Buffered_DatagramConnection Class Reference
Inheritance diagram for Buffered_DatagramConnection:
Socket_TCP Socket_IP TypedObject MemoryBase

Public Member Functions

 Buffered_DatagramConnection (int rbufsize, int wbufsize, int write_flush_point)
 
virtual ~Buffered_DatagramConnection (void)
 This is the function that does the connection for us.
 
void AddAddress (Socket_Address &inadr)
 must be called to set value to the server
 
size_t AddressQueueSize ()
 
void ClearAddresses (void)
 
bool DoConnect (void)
 
bool Flush (void)
 Flush all writes.
 
virtual TypeHandle force_init_type ()
 
virtual TypeHandle get_type () const
 
bool GetMessage (Datagram &val)
 Reads a message.
 
bool IsConnected (void)
 
void Reset (void)
 Reset.
 
bool SendMessage (const Datagram &msg)
 send the message
 
void WaitForNetworkReadEvent (PN_stdfloat MaxTime)
 
- Public Member Functions inherited from Socket_TCP
 Socket_TCP (SOCKET)
 
bool ActiveOpen (const Socket_Address &theaddress, bool setdelay)
 This function will try and set the socket up for active open to a specified address and port provided by the input parameter.
 
bool ActiveOpenNonBlocking (const Socket_Address &theaddress)
 This function will try and set the socket up for active open to a specified address and port provided by the input parameter (non-blocking version)
 
int DontLinger ()
 Turn off the linger flag.
 
bool ErrorIs_WouldBlocking (int err)
 
int RecvData (char *data, int size)
 Read the data from the connection - if error 0 if socket closed for read or length is 0 + bytes read ( May be smaller than requested)
 
std::string RecvData (int max_len)
 Read the data from the connection - if error 0 if socket closed for read or length is 0 + bytes read (May be smaller than requested)
 
int SendData (const char *data, int size)
 Ok Lets Send the Data - if error 0 if socket closed for write or lengh is 0 + bytes writen ( May be smaller than requested)
 
int SendData (const std::string &str)
 
int SetLinger (int interval_seconds=0)
 will control the behavior of SO_LINGER for a TCP socket
 
int SetNoDelay (bool flag=true)
 Disable Nagle algorithm.
 
int SetSendBufferSize (int insize)
 Just like it sounds.
 
bool ShutdownSend ()
 
- Public Member Functions inherited from Socket_IP
 Socket_IP ()
 Def Constructor.
 
 Socket_IP (SOCKET in)
 Assigns an existing socket to this class.
 
virtual ~Socket_IP ()
 Destructor.
 
bool Active ()
 Ask if the socket is open (allocated)
 
void Close ()
 Closes a socket if it is open (allocated).
 
Socket_Address GetPeerName (void) const
 Wrapper on berkly getpeername...
 
SOCKET GetSocket ()
 Gets the base socket type.
 
SOCKET GetSocket () const
 Get The RAW file id of the socket.
 
int SetBlocking ()
 Set the socket to block on subsequent calls to socket functions that address this socket.
 
int SetNonBlocking ()
 this function will throw a socket into non-blocking mode
 
int SetRecvBufferSize (int size)
 Ok it sets the recv buffer size for both tcp and UDP.
 
bool SetReuseAddress (bool flag=true)
 Informs a socket to reuse IP address as needed.
 
void SetSocket (SOCKET ins)
 Assigns an existing socket to this class.
 
bool SetV6Only (bool flag)
 Sets a flag indicating whether this IPv6 socket should operate in dual-stack mode or not.
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer.
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer.
 
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.
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from MemoryBase
void operator delete (void *, void *)
 
void operator delete (void *ptr)
 
void operator delete[] (void *, void *)
 
void operator delete[] (void *ptr)
 
void * operator new (size_t size)
 
void * operator new (size_t size, void *ptr)
 
void * operator new[] (size_t size)
 
void * operator new[] (size_t size, void *ptr)
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from Socket_TCP
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from Socket_IP
static TypeHandle get_class_type ()
 
static int GetLastError ()
 Gets the last errcode from a socket operation.
 
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.
 

Friends

class Buffered_DatagramReader
 
class Buffered_DatagramWriter
 

Additional Inherited Members

- Public Attributes inherited from TypedObject
 get_type
 

Detailed Description

Definition at line 35 of file buffered_datagramconnection.h.

Constructor & Destructor Documentation

◆ Buffered_DatagramConnection()

Buffered_DatagramConnection::Buffered_DatagramConnection ( int rbufsize,
int wbufsize,
int write_flush_point )
inlineexplicit

Definition at line 218 of file buffered_datagramconnection.h.

◆ ~Buffered_DatagramConnection()

Buffered_DatagramConnection::~Buffered_DatagramConnection ( void )
inlinevirtual

This is the function that does the connection for us.

Definition at line 211 of file buffered_datagramconnection.h.

References Socket_IP::Close().

Member Function Documentation

◆ AddAddress()

void Buffered_DatagramConnection::AddAddress ( Socket_Address & inadr)
inline

must be called to set value to the server

Definition at line 242 of file buffered_datagramconnection.h.

◆ AddressQueueSize()

size_t Buffered_DatagramConnection::AddressQueueSize ( )
inline

Definition at line 105 of file buffered_datagramconnection.h.

◆ ClearAddresses()

void Buffered_DatagramConnection::ClearAddresses ( void )
inline

Definition at line 247 of file buffered_datagramconnection.h.

◆ DoConnect()

bool Buffered_DatagramConnection::DoConnect ( void )
inline

Definition at line 148 of file buffered_datagramconnection.h.

◆ Flush()

bool Buffered_DatagramConnection::Flush ( void )
inline

Flush all writes.

Definition at line 276 of file buffered_datagramconnection.h.

References RingBuffer::AmountBuffered(), and Socket_IP::GetLastError().

◆ force_init_type()

virtual TypeHandle Buffered_DatagramConnection::force_init_type ( )
inlinevirtual

Reimplemented from Socket_TCP.

Definition at line 129 of file buffered_datagramconnection.h.

◆ get_class_type()

static TypeHandle Buffered_DatagramConnection::get_class_type ( )
inlinestatic

Definition at line 118 of file buffered_datagramconnection.h.

◆ get_type()

virtual TypeHandle Buffered_DatagramConnection::get_type ( ) const
inlinevirtual

Reimplemented from Socket_TCP.

Definition at line 126 of file buffered_datagramconnection.h.

◆ GetMessage()

bool Buffered_DatagramConnection::GetMessage ( Datagram & val)
inline

Reads a message.

Returns false on failure.

Definition at line 254 of file buffered_datagramconnection.h.

References RingBuffer::AmountBuffered().

◆ init_type()

static void Buffered_DatagramConnection::init_type ( )
inlinestatic

Definition at line 121 of file buffered_datagramconnection.h.

◆ IsConnected()

bool Buffered_DatagramConnection::IsConnected ( void )
inline

Definition at line 304 of file buffered_datagramconnection.h.

◆ Reset()

void Buffered_DatagramConnection::Reset ( void )
inline

Reset.

Definition at line 297 of file buffered_datagramconnection.h.

◆ SendMessage()

bool Buffered_DatagramConnection::SendMessage ( const Datagram & msg)

send the message

Definition at line 21 of file buffered_datagramconnection.cxx.

References RingBuffer::AmountBuffered(), Datagram::get_data(), and Datagram::get_length().

◆ WaitForNetworkReadEvent()

void Buffered_DatagramConnection::WaitForNetworkReadEvent ( PN_stdfloat MaxTime)
inline

Definition at line 95 of file buffered_datagramconnection.h.

Friends And Related Symbol Documentation

◆ Buffered_DatagramReader

friend class Buffered_DatagramReader
friend

Definition at line 114 of file buffered_datagramconnection.h.

◆ Buffered_DatagramWriter

friend class Buffered_DatagramWriter
friend

Definition at line 115 of file buffered_datagramconnection.h.


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