Panda3D
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties
Public Member Functions | Static Public Member Functions
Socket_TCP Class Reference

Base functionality for a TCP connected socket This class is pretty useless by itself but it does hide some of the platform differences from machine to machine. More...

Inheritance diagram for Socket_TCP:
Socket_IP TypedObject Buffered_DatagramConnection

List of all members.

Public Member Functions

bool ActiveOpen (Socket_Address const 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 (Socket_Address const 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 ErrorIsWouldBlocking (int err)
string RecvData (int max_len)
 Read the data from the connection.
int SendData (string str)
int SetLinger (int interval_seconds)
 will control the behavior of SO_LINGER for a TCP socket
int SetLinger ()
 will control the behavior of SO_LINGER for a TCP socket
int SetNoDelay (bool flag)
 Disable Nagle algorithm.
int SetNoDelay ()
 Disable Nagle algorithm.
int SetSendBufferSize (int insize)
 Just like it sounds.
bool ShutdownSend ()
 SocketTCP ()
 SocketTCP (int)

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

Base functionality for a TCP connected socket This class is pretty useless by itself but it does hide some of the platform differences from machine to machine.


Member Function Documentation

bool ActiveOpen ( Socket_Address const  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 ( Socket_Address const  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)

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.

bool ErrorIsWouldBlocking ( int  err)
static TypeHandle getClassType ( ) [static]

Reimplemented from Socket_IP.

Reimplemented in Buffered_DatagramConnection.

string RecvData ( int  max_len)

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)
int SendData ( string  str)
int SetLinger ( int  interval_seconds)

will control the behavior of SO_LINGER for a TCP socket

will control the behavior of SO_LINGER for a TCP socket

int SetNoDelay ( bool  flag)

Disable Nagle algorithm.

Don't delay send to coalesce packets

Disable Nagle algorithm.

Don't delay send to coalesce packets

int SetSendBufferSize ( int  insize)

Just like it sounds.

Sets a buffered socket recv buffer size. This function does not refuse ranges outside hard-coded OS limits

bool ShutdownSend ( )
SocketTCP ( )
SocketTCP ( int  )
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties