Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

RNReplicaNet::XPSocketUrgent Class Reference

#include <XPSocketUrgentClass.h>

Inheritance diagram for RNReplicaNet::XPSocketUrgent:

Inheritance graph
[legend]
Collaboration diagram for RNReplicaNet::XPSocketUrgent:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int Create (const int port=XPSOCK_PORT_ANY)
int SetRawMode (const bool RawMode=true)
int MakeBroadcast (void)
int ProcessACKS (void)
int SendWithACK (const char *data, const int len, const XPAddress &addr)
int Send (const char *data, const XPAddress &addr)
int Send (const char *data, const int len, const XPAddress &addr)
int Recv (char *const data, const int maxlen, XPAddress *const addr)

Static Public Member Functions

static int GetMaxPacketSize (void)

Detailed Description

An extension to the normal XPSocket class that handles urgent but unreliable packets. This call also makes use of the function in the XPSocket base class Most member functions return an XPSOCK_EERROR code. XPSOCK_EOK indicates no error. XPSOCK_EWOULDBLOCK is a non-fatal error and means the socket operation would have blocked the current thread at this point. If XPSOCK_EERROR is returned the user should use XPSocket::GetLastError() to find out the actual error code


Member Function Documentation

int XPSocketUrgent::Create const int  port = XPSOCK_PORT_ANY  ) 
 

Creates an urgent socket. Communication through this socket is faster but less reliable. A mechanism is supplied to enable data to be sent in a reliable manner but at the expense of CPU time and network bandwidth Returns XPSOCK_EERROR if an error occurred If port is zero (0) or XPSOCK_PORT_ANY then the network layer will pick a port number to be bound to Using a value of zero for the port when operating a client is advised since the any chosen port might already be in use

Returns:
returns a pointer to new socket or an XPSOCK_EERROR error code.

static int RNReplicaNet::XPSocketUrgent::GetMaxPacketSize void   )  [inline, static]
 

Returns the maximum size for a packet

Returns:
the maximum size for a data packet for this socket

Reimplemented from RNReplicaNet::XPSocket.

int XPSocketUrgent::MakeBroadcast void   ) 
 

Makes an urgent socket broadcast capable

Returns:
returns an XPSOCK error code.

int XPSocketUrgent::ProcessACKS void   ) 
 

Processes the socket ACK queue. Returns the number of pending ACKs left to be received for outbound data. This should be called once a frame if urgent sockets with ACKs are used

Returns:
returns the number of pending socket ACKs.

int XPSocketUrgent::Recv char *const   data,
const int  maxlen,
XPAddress *const   addr
 

Receives data from an urgent socket

Parameters:
data pointer to a data buffer
maximum length of the data buffer
addr the address of the sending socket for any data received
Returns:
returns the length of the data received or 0 if no data pending or an XPSOCK_EERROR error code

int XPSocketUrgent::Send const char *  data,
const int  len,
const XPAddress addr
 

Send an urgent packet from the socket to the specified address. The data sent is not guaranteed to arrive at the destination. This will return XPSOCK_EUDPSENDFAILED if this method doesn't exist. If so use a non-urgent socket

Parameters:
data the pointer to the data to send
len the length of the data to send
the address and port number to send to
Returns:
returns an XPSOCK_EERROR error code.

int XPSocketUrgent::Send const char *  data,
const XPAddress addr
 

Sends a NULL terminated string to the peer (the connected machine) for this socket

Parameters:
data The pointer to the NULL terminated string
Returns:
returns an XPSOCK_EERROR code.

int XPSocketUrgent::SendWithACK const char *  data,
const int  len,
const XPAddress addr
 

Sends data via the urgent socket to the supplied address and requests that the data is ACK'd and guaranteed to be received This will return XPSOCK_EUDPSENDFAILED if this method doesn't exist. If so use a non-urgent socket

Parameters:
data the pointer to the data to send
len the length of the data to send
the addres and port number to send to
Returns:
returns an XPSOCK_EERROR error code.

int XPSocketUrgent::SetRawMode const bool  RawMode = true  ) 
 

Sets the raw mode for urgent sockets to be true or false. If true then the ACK layer will not add sequence data.

Parameters:
RawMode the bool status of the raw mode send to set. The default is to be true.
Returns:
returns an XPSOCK error code.


The documentation for this class was generated from the following files:
Generated on Sun Oct 30 01:12:24 2005 for XPSockets by  doxygen 1.4.1