UDPSocket Class Reference

UDP/IP socket class. More...

#include <udpsocket.h>

Inheritance diagram for UDPSocket:

CoreSocket

List of all members.

Public Member Functions

 UDPSocket ()
 The constructor.
 ~UDPSocket ()
 The destructor.
int Bind (const char *_address, unsigned short _port)
 Binds an outbound UDP/IP socket to the specified address and port.
int Listen (unsigned short _port)
 Binds an inbound UDP/IP socket on the specified port.

Private Member Functions

int SetAttributes (socket_t _socket)
 Sets some important attributes on the socket.


Detailed Description

UDP/IP socket class.

Used for connectionless UDP/IP communication. Note that this is one-way, and there must be a second UDP/IP socket created for communication in the opposite direction.


Member Function Documentation

int Bind ( const char *  _address,
unsigned short  _port 
)

Binds an outbound UDP/IP socket to the specified address and port.

Parameters:
_address The remote address to bind to. Can be a hostname, as it will be resolved by gethostbyname().
_port The remote port to bind to.
Returns:
Due to the use of Berkley sockets, this returns zero on success, and a nonzero value on failure.

int Listen ( unsigned short  _port  )  [virtual]

Binds an inbound UDP/IP socket on the specified port.

Parameters:
_port The port to bind.
Returns:
Due to the use of Berkley sockets, this returns zero on success, and a nonzero value on failure.

Implements CoreSocket.

int SetAttributes ( socket_t  _socket  )  [private, virtual]

Sets some important attributes on the socket.

Will set SO_LINGER and TCP_NODELAY on TCP sockets.

Parameters:
_socket The socket to modify.
Returns:
CC_ERR_NONE if no error is encountered, otherwise returns 'errno'.

Implements CoreSocket.


Generated on Sun Feb 8 11:10:00 2009 for CrissCross by  doxygen 1.5.8