libglass::TCP Class Reference

#include <tcp.h>

Inheritance diagram for libglass::TCP:

libglass::Protocol

List of all members.

Public Member Functions

 TCP ()
 ~TCP ()
nodeId getUniqueId (void)

Protected Member Functions

int _listen (unsigned int port)
nodeFD _accept (void)
nodeFD _connect (const char *host, unsigned int port)
void _disconnect (nodeFD node)
bool _send (Packet &p)
int _recv (Packet &p)
int _safely_close_socket (nodeFD fd)

Protected Attributes

union {
   struct {
      int   sockfd
      int   fdmax
      fd_set   clients
      struct timeval   default_timeout
      bool   no_timeout
   }   server
   struct {
      int   sockfd
   }   client
data
 Internal data union (server/client).
PacketLog * plog

Static Protected Attributes

static const unsigned int default_port = 9191
 Default port.


Detailed Description

Definition at line 48 of file tcp.h.


Constructor & Destructor Documentation

libglass::TCP::TCP (  ) 

libglass::TCP::~TCP (  ) 


Member Function Documentation

nodeFD libglass::TCP::_accept ( void   )  [protected, virtual]

This is the derived class implementation of accept().

See also:
nodeFD accept(void)

Implements libglass::Protocol.

nodeFD libglass::TCP::_connect ( const char *  host,
unsigned int  port 
) [protected, virtual]

This is the derived class implementation of connect().

See also:
nodeFD connect(const char *host, unsigned int port);

Implements libglass::Protocol.

void libglass::TCP::_disconnect ( nodeFD  node  )  [protected, virtual]

This is the derived class implementation of disconnect().

See also:
void disconnect(nodeFD node)

Implements libglass::Protocol.

int libglass::TCP::_listen ( unsigned int  port  )  [protected, virtual]

This is the derived class implementation of listen().

See also:
int listen(unsigned int port)

Implements libglass::Protocol.

int libglass::TCP::_recv ( Packet p  )  [protected, virtual]

This is the derived class implementation of recv().

See also:
int recv(Packet &p)

Implements libglass::Protocol.

int libglass::TCP::_safely_close_socket ( nodeFD  fd  )  [protected]

bool libglass::TCP::_send ( Packet p  )  [protected, virtual]

This is the derived class implementation of send().

See also:
bool _send(Packet &p)

Implements libglass::Protocol.

nodeId libglass::TCP::getUniqueId ( void   )  [virtual]

Returns:

Implements libglass::Protocol.


Member Data Documentation

struct { ... } libglass::TCP::client

List of sockets to clients.

Definition at line 78 of file tcp.h.

union { ... } libglass::TCP::data [protected]

Internal data union (server/client).

const unsigned int libglass::TCP::default_port = 9191 [static, protected]

Default port.

Definition at line 70 of file tcp.h.

struct timeval libglass::TCP::default_timeout [read]

Default timeout

Definition at line 79 of file tcp.h.

Maximum client socket number.

Definition at line 77 of file tcp.h.

Definition at line 80 of file tcp.h.

PacketLog* libglass::TCP::plog [protected]

Definition at line 87 of file tcp.h.

struct { ... } libglass::TCP::server

Listener socket.

Socket to server.

Definition at line 76 of file tcp.h.


The documentation for this class was generated from the following file:

Generated on Fri May 28 13:19:01 2010 for libGlass by  doxygen 1.5.8