XPStream Class Reference

#include <XPStream.h>

Inheritance diagram for XPStream:

Inheritance graph
[legend]
Collaboration diagram for 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

Constructor & Destructor Documentation

XPStream (  ) 

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

~XPStream (  )  [virtual]

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


Member Function Documentation

int Create ( void   )  [virtual]

Creates a XPStream

Returns:
returns an XPSOCK_EERROR code

Reimplemented from XPSocket.

int Close ( void   ) 

Closes a XPStream

Returns:
returns an XPSOCK_EERROR code

Reimplemented from XPSocket.

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 XPSocket.

int 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 XPSocket.

int 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 XPSocket.

int GetMaxPacketSize ( void   )  [inline]

Returns the maximum size for a packet

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

Reimplemented from XPSocket.


Generated on Sat Jun 28 22:02:29 2008 for ReplicaNet and RNLobby by  doxygen 1.5.3