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

RNReplicaNet::XPStream Class Reference

#include <XPStream.h>

Inheritance diagram for RNReplicaNet::XPStream:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XPStream ()
virtual ~XPStream ()
int Create ()
int Close ()
XPStreamAccept (void)
int Send (const char *data, const int len)
int Recv (char *const data, const int maxlen)
int GetMaxPacketSize (void)

Detailed Description

An implementation enabling a program to send packets via the sockets interface and not lose packet integrity by the transport medium fragmenting packets 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

Todo:
The XPStream relies too heavily on the underlying XPSocket API. Consider separating this API from the socket base class


Constructor & Destructor Documentation

XPStream::XPStream  ) 
 

The ctor for an XPStream At this point no connection is made for the stream

XPStream::~XPStream  )  [virtual]
 

The dtor for an XPStream This cleans up everything for this stream


Member Function Documentation

XPStream * XPStream::Accept void   ) 
 

Accepts any pending connections for this stream. This should be used with the Listen() member function defined in the XPSocket base class

Returns:
returns NULL if no connection was pending or returns the pointer to the new connected XPStream or pcXPSOCK_EERROR if an error occured

Reimplemented from RNReplicaNet::XPSocket.

int XPStream::Close  ) 
 

Closes a XPStream

Returns:
returns an XPSOCK_EERROR code

Reimplemented from RNReplicaNet::XPSocket.

int XPStream::Create  )  [virtual]
 

Creates a XPStream

Returns:
returns an XPSOCK_EERROR code

Reimplemented from RNReplicaNet::XPSocket.

int RNReplicaNet::XPStream::GetMaxPacketSize void   )  [inline]
 

Returns the maximum size for a packet

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

Reimplemented from RNReplicaNet::XPSocket.

int XPStream::Recv char *const   data,
const int  maxlen
 

Tries to recv a packet from the stream

Parameters:
data the pointer to the data buffer to receive the packet
maxlen the maximum length of the data buffer
Returns:
returns the length of the data received or 0 for no data pending or an XPSOCK_EERROR code.

Reimplemented from RNReplicaNet::XPSocket.

int XPStream::Send const char *  data,
const int  len
 

Sends a packet from the connected stream

Parameters:
data the pointer to the data to send
len the length of the data to send
Returns:
returns an XPSOCK_EERROR code

Reimplemented from RNReplicaNet::XPSocket.


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