#include <tcp.h>
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. |
Definition at line 48 of file tcp.h.
libglass::TCP::TCP | ( | ) |
libglass::TCP::~TCP | ( | ) |
nodeFD libglass::TCP::_accept | ( | void | ) | [protected, virtual] |
This is the derived class implementation of accept().
Implements libglass::Protocol.
nodeFD libglass::TCP::_connect | ( | const char * | host, | |
unsigned int | port | |||
) | [protected, virtual] |
This is the derived class implementation of connect().
Implements libglass::Protocol.
void libglass::TCP::_disconnect | ( | nodeFD | node | ) | [protected, virtual] |
This is the derived class implementation of disconnect().
Implements libglass::Protocol.
int libglass::TCP::_listen | ( | unsigned int | port | ) | [protected, virtual] |
This is the derived class implementation of listen().
Implements libglass::Protocol.
int libglass::TCP::_recv | ( | Packet & | p | ) | [protected, virtual] |
This is the derived class implementation of recv().
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().
Implements libglass::Protocol.
nodeId libglass::TCP::getUniqueId | ( | void | ) | [virtual] |
struct { ... } libglass::TCP::client |
fd_set libglass::TCP::clients |
union { ... } libglass::TCP::data [protected] |
Internal data union (server/client).
const unsigned int libglass::TCP::default_port = 9191 [static, protected] |
struct timeval libglass::TCP::default_timeout [read] |
PacketLog* libglass::TCP::plog [protected] |
struct { ... } libglass::TCP::server |