Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# TCPEndpoint Class Reference

handels a TCP-Connection More...

`#include <TCPEndpoint.h>`

Inheritance diagram for TCPEndpoint:

[legend]
Collaboration diagram for TCPEndpoint:

[legend]
List of all members.

## Public Types
enum | statusID { closed, connecting, connected, listening, sending, receiving, closing }
## Public Member Functions
| TCPEndpoint (int sendBufferSize=8192, int receiveBufferSize=8192)
| TCPEndpoint (char *address, int port)
| ~TCPEndpoint ()
int | listen (int port)
int | connect (char *address, int port)
int | send (void *Data, int size)
int | close ()
virtual void | onConnect (void)
virtual void | onReceive (void *Data, int size)
virtual void | onClose (int reason)
virtual void | onSendingDone (void)
const char * | getErrorString (TCPEndpointError error)
virtual void | listenCont (antEnvMsg *msg)
virtual void | sendCont (antEnvMsg *msg)
virtual void | receiveCont (antEnvMsg *msg)
virtual void | closeCont (antEnvMsg *msg)
virtual void | connectCont (antEnvMsg *msg)
statusID | getStatus (void)
## Protected Member Functions
void | startReceiving ()
## Protected Attributes
IPAddress | address
Port | port
statusID | status
bool | wasListening
int | sizeOfDataToSend
void * | sendDataBuffer
## Private Member Functions
void | sendSendMessage (int size)

## Detailed Description

handels a TCP-Connection

Definition at line 22 of file TCPEndpoint.h.

## Member Enumeration Documentation

enum TCPEndpoint::statusID

  | Enumeration values:
  closed |
  connecting |
  connected |
  listening |
  sending |
  receiving |
  closing |
Definition at line 25 of file TCPEndpoint.h. Referenced by getStatus().

## Constructor & Destructor Documentation

TCPEndpoint::TCPEndpoint | ( | int | sendBufferSize = 8192,
|  | int | receiveBufferSize = 8192
| ) |

| Definition at line 18 of file TCPEndpoint.cpp. References address, closed, status, and wasListening.

TCPEndpoint::TCPEndpoint | ( | char * | address,
|  | int | port
| ) |

| Definition at line 27 of file TCPEndpoint.cpp. References connect().

Here is the call graph for this function:

TCPEndpoint::~TCPEndpoint | ( |  | ) |

| Definition at line 33 of file TCPEndpoint.cpp. References close().

Here is the call graph for this function:

## Member Function Documentation

int TCPEndpoint::listen | ( | int | port | ) |

| Definition at line 101 of file TCPEndpoint.cpp. References listening, status, and VERIFY. Referenced by closeCont().

int TCPEndpoint::connect | ( | char * | address,
|  | int | port
| ) |

| Definition at line 44 of file TCPEndpoint.cpp. References connecting, and status. Referenced by TCPEndpoint().

int TCPEndpoint::send | ( | void * | Data,
|  | int | size
| ) |

| Definition at line 154 of file TCPEndpoint.cpp. References connected, MAXSENDSIZE, sendDataBuffer, sendSendMessage(), sizeOfDataToSend, and status. Referenced by TestServer::onConnect(), TestServer::onReceive(), and TCPHandler::sendPackage().

Here is the call graph for this function:

int TCPEndpoint::close | ( |  | ) |

| Definition at line 294 of file TCPEndpoint.cpp. References closed, closing, and status. Referenced by TestServer::onReceive(), receiveCont(), sendCont(), and ~TCPEndpoint().

void TCPEndpoint::onConnect | ( | void |  | ) | `[virtual]`

| Reimplemented in TestServer, and TCPHandler. Definition at line 94 of file TCPEndpoint.cpp. Referenced by connectCont(), and listenCont().

void TCPEndpoint::onReceive | ( | void * | Data,
|  | int | size
| ) | `[virtual]`

| Reimplemented in TestServer, and TCPHandler. Definition at line 285 of file TCPEndpoint.cpp. Referenced by receiveCont().

void TCPEndpoint::onClose | ( | int | reason | ) | `[virtual]`

| Reimplemented in TCPHandler. Definition at line 308 of file TCPEndpoint.cpp. Referenced by receiveCont().

void TCPEndpoint::onSendingDone | ( | void |  | ) | `[virtual]`

| Reimplemented in TCPHandler. Definition at line 235 of file TCPEndpoint.cpp. Referenced by sendCont().

const char * TCPEndpoint::getErrorString | ( | TCPEndpointError | error | ) |

| Definition at line 331 of file TCPEndpoint.cpp. Referenced by closeCont(), connectCont(), listenCont(), receiveCont(), and sendCont().

void TCPEndpoint::listenCont | ( | antEnvMsg * | msg | ) | `[virtual]`

| Reimplemented from IPEndpoint. Definition at line 129 of file TCPEndpoint.cpp. References connected, getErrorString(), onConnect(), startReceiving(), status, and wasListening.

Here is the call graph for this function:

void TCPEndpoint::sendCont | ( | antEnvMsg * | msg | ) | `[virtual]`

| Reimplemented from IPEndpoint. Definition at line 188 of file TCPEndpoint.cpp. References close(), connected, getErrorString(), MAXSENDSIZE, onSendingDone(), sendDataBuffer, sendSendMessage(), sizeOfDataToSend, and status.

Here is the call graph for this function:

void TCPEndpoint::receiveCont | ( | antEnvMsg * | msg | ) | `[virtual]`

| Reimplemented from IPEndpoint. Definition at line 251 of file TCPEndpoint.cpp. References close(), connected, getErrorString(), onClose(), onReceive(), startReceiving(), and status.

Here is the call graph for this function:

void TCPEndpoint::closeCont | ( | antEnvMsg * | msg | ) | `[virtual]`

| Reimplemented from IPEndpoint. Definition at line 313 of file TCPEndpoint.cpp. References closed, getErrorString(), listen(), status, and wasListening.

Here is the call graph for this function:

void TCPEndpoint::connectCont | ( | antEnvMsg * | msg | ) | `[virtual]`

| Reimplemented from IPEndpoint. Definition at line 70 of file TCPEndpoint.cpp. References closed, connected, getErrorString(), onConnect(), startReceiving(), and status.

Here is the call graph for this function:

statusID TCPEndpoint::getStatus | ( | void |  | ) | `[inline]`

| Definition at line 58 of file TCPEndpoint.h. References status, and statusID.

void TCPEndpoint::startReceiving | ( |  | ) | `[protected]`

| Definition at line 241 of file TCPEndpoint.cpp. References connected, and status. Referenced by connectCont(), listenCont(), and receiveCont().

void TCPEndpoint::sendSendMessage | ( | int | size | ) | `[private]`

| Definition at line 226 of file TCPEndpoint.cpp. References status. Referenced by send(), and sendCont().

## Member Data Documentation

IPAddress TCPEndpoint::address`[protected]`

| Definition at line 63 of file TCPEndpoint.h. Referenced by TCPEndpoint().

Port TCPEndpoint::port`[protected]`

| Definition at line 64 of file TCPEndpoint.h.

statusID TCPEndpoint::status`[protected]`

| Definition at line 65 of file TCPEndpoint.h. Referenced by close(), closeCont(), connect(), connectCont(), getStatus(), listen(), listenCont(), receiveCont(), send(), sendCont(), sendSendMessage(), startReceiving(), and TCPEndpoint().

bool TCPEndpoint::wasListening`[protected]`

| Definition at line 67 of file TCPEndpoint.h. Referenced by closeCont(), listenCont(), and TCPEndpoint().

int TCPEndpoint::sizeOfDataToSend`[protected]`

| Definition at line 68 of file TCPEndpoint.h. Referenced by send(), and sendCont().

void* TCPEndpoint::sendDataBuffer`[protected]`

| Definition at line 69 of file TCPEndpoint.h. Referenced by send(), and sendCont().

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

- Platform/Aperios1.3.2/TCPEndpoint.h
- Platform/Aperios1.3.2/TCPEndpoint.cpp