Panda3D
Public Member Functions | Static Public Member Functions | Friends
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 HttpConnection Socket_UDP Http_Request

List of all members.

Public Member Functions

 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)
virtual TypeHandle force_init_type ()
virtual TypeHandle get_type () const
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.

Static Public Member Functions

static TypeHandle get_class_type ()
static int GetLastError ()
 gets the last errcode from a socket operation
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.
static int InitNetworkDriver ()

Friends

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

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

socket_fdset

Definition at line 34 of file socket_ip.h.


Constructor & Destructor Documentation

Socket_IP::Socket_IP ( ) [inline]

Def Constructor.

Definition at line 114 of file socket_ip.h.

Socket_IP::Socket_IP ( SOCKET  in) [inline]

Assigns an existing socket to this class.

Definition at line 123 of file socket_ip.h.

Socket_IP::~Socket_IP ( ) [inline, virtual]

Destructor.

Definition at line 132 of file socket_ip.h.

References Close().


Member Function Documentation

bool Socket_IP::Active ( ) [inline]

Ask if the socket is open (allocated)

Definition at line 105 of file socket_ip.h.

Referenced by Close().

void Socket_IP::Close ( ) [inline]
int Socket_IP::GetLastError ( ) [inline, static]

gets the last errcode from a socket operation

Definition at line 152 of file socket_ip.h.

Referenced by Buffered_DatagramConnection::Flush(), Socket_UDP_Incoming::GetPacket(), and ConnectionListener::process_incoming_data().

Socket_Address Socket_IP::GetPeerName ( void  ) const [inline]

Wrapper on berkly getpeername...

Definition at line 257 of file socket_ip.h.

Referenced by Connection::get_address().

SOCKET Socket_IP::GetSocket ( ) [inline]

Gets the base socket type.

Definition at line 240 of file socket_ip.h.

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

SOCKET Socket_IP::GetSocket ( ) const [inline]

Get The RAW file id of the socket.

Definition at line 249 of file socket_ip.h.

static void Socket_IP::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from TypedObject.

Reimplemented in Buffered_DatagramConnection, Http_Request, HttpConnection, Socket_UDP, Socket_TCP, Socket_UDP_Outgoing, Socket_UDP_Incoming, and Socket_TCP_Listen.

Definition at line 74 of file socket_ip.h.

References TypedObject::init_type().

Referenced by Socket_TCP_Listen::init_type(), Socket_UDP_Incoming::init_type(), Socket_UDP_Outgoing::init_type(), Socket_TCP::init_type(), and Buffered_DatagramConnection::init_type().

int Socket_IP::SetBlocking ( ) [inline]

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

Definition at line 207 of file socket_ip.h.

int Socket_IP::SetNonBlocking ( ) [inline]

this function will throw a socket into non-blocking mode

Definition at line 183 of file socket_ip.h.

Referenced by Socket_TCP::ActiveOpenNonBlocking(), and Connection::Connection().

int Socket_IP::SetRecvBufferSize ( int  size) [inline]

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

Definition at line 171 of file socket_ip.h.

Referenced by Connection::set_recv_buffer_size().

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

Informs a socket to reuse IP address as needed.

Definition at line 228 of file socket_ip.h.

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

void Socket_IP::SetSocket ( SOCKET  ins) [inline]

Assigns an existing socket to this class.

Definition at line 161 of file socket_ip.h.

References Close().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations