Panda3D
Public Member Functions | Static Public Member Functions

Socket_UDP Class Reference

Base functionality for a combination UDP Reader and Writer. More...

Inheritance diagram for Socket_UDP:
Socket_UDP_Incoming Socket_IP TypedObject MemoryBase

List of all members.

Public Member Functions

bool Active ()
 Ask if the socket is open (allocated)
 Close ()
 closes a socket if it is open (allocated)
Socket_Address GetPeerName ()
 Wrapper on berkly getpeername...
int GetSocket ()
 Gets the base socket type.
int GetSocket ()
 Get The RAW file id of the socket.
TypeHandle getType ()
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
bool InitNoAddress ()
 This will set a udp up for targeted sends.
bool InitToAddress (Socket_Address const address)
 Connects the Socket to a Specified address.
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly.
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type.
bool OpenForInput (Socket_Address const address)
 Starts a UDP socket listening on a port.
bool OpenForInputMCast (Socket_Address const address)
 Starts a UDP socket listening on a port.
bool Send (string data)
 Send data to connected address.
bool SendTo (string data, Socket_Address const address)
 Send data to specified address.
bool SendTo (string data, int len, Socket_Address const address)
 Send data to specified address.
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 ()
 Informs a socket to reuse IP address as needed.
bool SetReuseAddress (bool flag)
 Informs a socket to reuse IP address as needed.
 SetSocket (int ins)
 Assigns an existing socket to this class.
bool SetToBroadCast ()
 Ask the OS to let us receive BROADCASt packets on this port.
 SocketIP ()
 Def Constructor.
 SocketIP (int in)
 Assigns an existing socket to this class.
 SocketUDP ()
 SocketUDPIncoming ()

Static Public Member Functions

static TypeHandle getClassType ()
static int GetLastError ()
 gets the last errcode from a socket operation
static int InitNetworkDriver ()

Detailed Description

Base functionality for a combination UDP Reader and Writer.

This duplicates code from Socket_UDP_Outgoing, to avoid the problems of multiple inheritance.


Member Function Documentation

bool Active ( ) [inherited]

Ask if the socket is open (allocated)

Close ( ) [inherited]

closes a socket if it is open (allocated)

static TypeHandle getClassType ( ) [static]

Reimplemented from Socket_UDP_Incoming.

static int GetLastError ( ) [static, inherited]

gets the last errcode from a socket operation

Socket_Address GetPeerName ( ) [inherited]

Wrapper on berkly getpeername...

int GetSocket ( ) [inherited]

Gets the base socket type.

int GetSocket ( ) [inherited]

Get The RAW file id of the socket.

TypeHandle getType ( ) [inherited]

Reimplemented in AnimChannelBase.

int getTypeIndex ( ) [inherited]

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().

static int InitNetworkDriver ( ) [static, inherited]
bool InitNoAddress ( )

This will set a udp up for targeted sends.

Return type : inline bool Argument : void

Reimplemented from Socket_UDP_Incoming.

bool InitToAddress ( Socket_Address const  address)

Connects the Socket to a Specified address.

Return type : inline bool Argument : NetAddress & address

bool isExactType ( TypeHandle  handle) [inherited]

Returns true if the current object is the indicated type exactly.

bool isOfType ( TypeHandle  handle) [inherited]

Returns true if the current object is or derives from the indicated type.

bool OpenForInput ( Socket_Address const  address) [inherited]

Starts a UDP socket listening on a port.

Return type : bool Argument : NetAddress & address

bool OpenForInputMCast ( Socket_Address const  address) [inherited]

Starts a UDP socket listening on a port.

Return type : bool Argument : NetAddress & address

bool Send ( string  data)

Send data to connected address.

Return type : inline bool Argument : const string &data

bool SendTo ( string  data,
Socket_Address const  address 
)

Send data to specified address.

Return type : inline bool Argument : const string &data Argument : NetAddress & address

bool SendTo ( string  data,
int  len,
Socket_Address const  address 
) [inherited]

Send data to specified address.

Return type : inline bool Argument : char * data Argument : int len Argument : NetAddress & address

int SetBlocking ( ) [inherited]

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

int SetNonBlocking ( ) [inherited]

this function will throw a socket into non-blocking mode

int SetRecvBufferSize ( int  size) [inherited]

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

bool SetReuseAddress ( bool  flag) [inherited]

Informs a socket to reuse IP address as needed.

bool SetReuseAddress ( ) [inherited]

Informs a socket to reuse IP address as needed.

SetSocket ( int  ins) [inherited]

Assigns an existing socket to this class.

bool SetToBroadCast ( )

Ask the OS to let us receive BROADCASt packets on this port.

Return type : bool Argument : void

Reimplemented from Socket_UDP_Incoming.

SocketIP ( int  in) [inherited]

Assigns an existing socket to this class.

SocketIP ( ) [inherited]

Def Constructor.

SocketUDP ( )
SocketUDPIncoming ( ) [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties