# Buffered_DatagramConnection

from pandac.PandaModules import Buffered_DatagramConnection

there are 3 states
1. Socket not even assigned,,,, 2. Socket Assigned and trying to get a active connect open 3. Socket is open and writable.. ( Fully powered up )...

## Inheritance:

Buffered_DatagramConnection: Socket_TCP
Socket_TCP: Socket_IP
Socket_IP: TypedObject
TypedObject: MemoryBase
MemoryBase:

## Methods of Buffered_DatagramConnection:

BufferedDatagramConnection (Constructor)
AddAddress
AddressQueueSize
ClearAddresses
DoConnect
Flush
getClassType
GetMessage
IsConnected
Reset
SendMessage
WaitForNetworkReadEvent

## Methods of Socket_TCP:

SocketTCP (Constructor)
ActiveOpen
ActiveOpenNonBlocking
DontLinger
ErrorIsWouldBlocking
getClassType
RecvData
SendData
SetLinger
SetNoDelay
SetSendBufferSize
ShutdownSend

## Methods of Socket_IP:

SocketIP (Constructor)
Active
Close
getClassType
GetLastError
GetPeerName
GetSocket
InitNetworkDriver
SetBlocking
SetNonBlocking
SetRecvBufferSize
SetReuseAddress
SetSocket

## Methods of TypedObject:

getClassType
getType
getTypeIndex
isExactType
isOfType

BufferedDatagramConnection Buffered_DatagramConnection::Buffered_DatagramConnection(int rbufsize, int wbufsize, int write_flush_point); all the real state magic is in here Function name : Buffered_DatagramConnection::Buffered_DatagramConnection Description : Return type : inline Argument : bool do_blocking_writes Argument : int rbufsize Argument : int wbufsize

AddAddress void Buffered_DatagramConnection::AddAddress(Socket_Address &inadr); address queue stuff Function name : Buffered_DatagramConnection::Init Description : must be called to set value to the server Return type : inline void Argument : Socket_Address &inadr

AddressQueueSize unsigned int Buffered_DatagramConnection::AddressQueueSize(void); address queue stuff

ClearAddresses void Buffered_DatagramConnection::ClearAddresses(void); Undocumented function.

DoConnect bool Buffered_DatagramConnection::DoConnect(void); Undocumented function.

Flush bool Buffered_DatagramConnection::Flush(void); the reason thsi all exists Function name : Buffered_DatagramConnection::Flush Description : flush all wrightes Return type : bool Argument : void

getClassType static TypeHandle Buffered_DatagramConnection::get_class_type(void); Undocumented function.

GetMessage bool Buffered_DatagramConnection::GetMessage(Datagram &val); do not use this .. this is a way for the the COnnecting UPcall to drop messages in queue first.. Function name : Buffered_DatagramConnection::GetMessage Description : read a message false means something bad happened.. Return type : inline bool Argument : Datagram &val

IsConnected bool Buffered_DatagramConnection::IsConnected(void); all the real state magic is in here

Reset void Buffered_DatagramConnection::Reset(void); Function name : Buffered_DatagramConnection::Reset Description : Reset Return type : void Argument : void

SendMessage bool Buffered_DatagramConnection::SendMessage(Datagram const &msg); the reason thsi all exists Function name : Buffered_DatagramConnection::SendMessage Description : send the message Return type : inline bool Argument : DataGram &msg

WaitForNetworkReadEvent void Buffered_DatagramConnection::WaitForNetworkReadEvent(float MaxTime); int WaitFor_Read_Error(const Socket_fdset & fd, const Time_Span & timeout);

SocketTCP Socket_TCP::Socket_TCP(int ); Function name : Socket_TCP::Socket_TCP Description :

ActiveOpen bool Socket_TCP::ActiveOpen(Socket_Address const &theaddress, bool setdelay); inline bool ActiveOpen(const Socket_Address & theaddress); Function name : ActiveOpen Description : This function will try and set the socket up for active open to a specified address and port provided by the input parameter

ActiveOpenNonBlocking bool Socket_TCP::ActiveOpenNonBlocking(Socket_Address const &theaddress); inline bool ActiveOpen(const Socket_Address & theaddress); Function name : ActiveOpenNonBlocking Description : 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)

DontLinger int Socket_TCP::DontLinger(void); Function name : Socket_TCP::DontLinger Description : Turn off the linger flag. The socket will quickly release buffered items and free up OS resources. You may lose a stream if you use this flag and do not negotiate the close at the application layer.

ErrorIsWouldBlocking bool Socket_TCP::ErrorIs_WouldBlocking(int err); Undocumented function.

getClassType static TypeHandle Socket_TCP::get_class_type(void); Undocumented function.

RecvData string Socket_TCP::RecvData(int max_len); inline int RecvData( std::string &str, int max_len); Function name : Socket_TCP::RecvData Description : Read the data from the connection Return type : int - if error 0 if socket closed for read or length is 0 + bytes read ( May be smaller than requested)

SendData int Socket_TCP::SendData(string const &str); Function name : Socket_TCP::SendData Description : Ok Lets Send the Data Return type : int - if error 0 if socket closed for write or lengh is 0 + bytes writen ( May be smaller than requested)

SetLinger int Socket_TCP::SetLinger(int interval_seconds = (0)); Function name : SetLinger Description : will control the behavior of SO_LINGER for a TCP socket

SetNoDelay int Socket_TCP::SetNoDelay(bool flag = (1)); Function name : SetNoDelay Description : Disable Nagle algorithm. Don't delay send to coalesce packets

SetSendBufferSize int Socket_TCP::SetSendBufferSize(int insize); Function name : SetSendBufferSize Description : Just like it sounds. Sets a buffered socket recv buffer size. This function does not refuse ranges outside hard-coded OS limits

ShutdownSend bool Socket_TCP::ShutdownSend(void); Undocumented function.

SocketIP Socket_IP::Socket_IP(void); Function name : Socket_IP::Socket_IP Description : Def Constructor Function name : Socket_IP::SetSocket Description : Assigns an existing socket to this class

Active bool Socket_IP::Active(void); Function name : Socket_IP::Active Description : Ask if the socket is open (allocated)

Close void Socket_IP::Close(void); Function name : Socket_IP::Close Description : closes a socket if it is open (allocated)

getClassType static TypeHandle Socket_IP::get_class_type(void); Undocumented function.

GetLastError static int Socket_IP::GetLastError(void); Function name : Socket_IP::GetLastError Description : gets the last errcode from a socket operation

GetPeerName Socket_Address Socket_IP::GetPeerName(void) const; Function name : Socket_IP::GetPeerName Description : Wrapper on berkly getpeername...

GetSocket int Socket_IP::GetSocket(void); Function name : Socket_IP::GetSocket Description : Gets the base socket type Description : Get The RAW file id of the socket

InitNetworkDriver static int Socket_IP::InitNetworkDriver(void); Undocumented function.

SetBlocking int Socket_IP::SetBlocking(void); Function name : Socket_IP::SetBlocking Description : Set the socket to block on subsequent calls to socket functions that address this socket

SetNonBlocking int Socket_IP::SetNonBlocking(void); Function name : SetNonBlocking Description : this function will throw a socket into non-blocking mode

SetRecvBufferSize int Socket_IP::SetRecvBufferSize(int size); Function name : Socket_IP::SetRecvBufferSize Description : Ok it sets the recv buffer size for both tcp and UDP

SetReuseAddress bool Socket_IP::SetReuseAddress(bool flag = (1)); Function name : SetReuseAddress Description : Informs a socket to reuse IP address as needed

SetSocket void Socket_IP::SetSocket(int ins); Function name : Socket_IP::SetSocket Description : Assigns an existing socket to this class

getClassType static TypeHandle TypedObject::get_class_type(void); Undocumented function.

getType virtual TypeHandle TypedObject::get_type(void) const = 0; Derived classes should override this function to return get_class_type().

getTypeIndex int TypedObject::get_type_index(void) const; Description: Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index().

isExactType bool TypedObject::is_exact_type(TypeHandle handle) const; Description: Returns true if the current object is the indicated type exactly.

isOfType bool TypedObject::is_of_type(TypeHandle handle) const; Description: Returns true if the current object is or derives from the indicated type.