Network
[Tools Library]

Collaboration diagram for Network:

Located in stechec/tools/datatfs directory.

There is already all that is needed for networking. See Cx, TcpCx, DirectCx, and Packet classes. More...

Classes

class  NetError
 Exception class for network errors. More...
class  NetSysError
 Exception class for network errors. More...
class  Cx
 Base class for network/file data transfert.

This class contain only methods related to data transfert (send, receive). Use a derived class to be able to open a connection, like FileCx or TcpCx. You can send/receive arbitrary data or file, or you can use the Packet class that already contains useful attributes. More...

struct  CxInit
struct  CxDeny
struct  CxList
struct  CxJoin
struct  CxError
class  CxPool< T >
class  DirectCx
class  FileCx
struct  Packet
 Container for data passed through network. More...
class  TcpCx
 Implements TCP networking.

This class implements TCP/IP data connections. Nagle algorithm is turned off, to speed up little but frequent transfers. More...

void stringToPacket (int *dst, const std::string &src, unsigned max_size)
 Encapsulate a string into a packet.
std::string packetToString (const int *src)
 Decapsulate a string from a packet.
const unsigned PACKET_SIZE_MAX = 2048
const unsigned BUF_SEND_SIZE = PACKET_SIZE_MAX * 4
const unsigned BUF_RECV_SIZE = PACKET_SIZE_MAX * 2
const int CX_CLOSED = 0x00
const int CX_READ = 0x01
const int CX_WRITE = 0x02
const int CX_RW = 0x03
const int CX_CONNECTING = 0x04
const int CX_LISTENING = 0x08

Enumerations

enum  eCxToken {
  CX_INIT = CX_TOKEN_START, CX_ACCEPT, CX_DENY, CX_QUERYLIST,
  CX_LIST, CX_JOIN, CX_READY, CX_ABORT,
  CX_ERROR, CX_TOKEN_LAST
}
 Network tokens.

Handled by Stechec in base_rules.

enum  ECxPollFdState { E_FD_READ_READY, E_FD_CONNECTION_PENDING, E_FD_CONNECTION_CLOSED }
enum  eCxWhoIAm { CXD_IS_SERVER, CXD_IS_COACH1, CXD_IS_COACH2 }

Variables

const unsigned CX_TOKEN_START = 0x8000


Detailed Description

Located in stechec/tools/datatfs directory.

There is already all that is needed for networking. See Cx, TcpCx, DirectCx, and Packet classes.


Function Documentation

void stringToPacket ( int *  dst,
const std::string &  src,
unsigned  max_size 
)

Encapsulate a string into a packet.

Parameters:
dst Packet attribute that will receive the string.
src Source string.
max_size Size of dst, in bytes.


Generated on Sat Jun 23 16:08:46 2007 for Stechec/TBT by  doxygen 1.4.7