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

# UDPEndpoint Class Reference

static class for system calls

Attention:
  the implementation is system specific!

More...

`#include <UDPEndpoint.h>`

Inheritance diagram for UDPEndpoint:

[legend]
Collaboration diagram for UDPEndpoint:

[legend]
List of all members.

## Public Member Functions
| UDPEndpoint (int sendBufferSize=2048, int receiveBufferSize=2048)
| ~UDPEndpoint ()
int | bind (int listenPort)
| binds endpoint to listen to port
int | bind (int listenPort, char *address, int sendPort)
| binds endpoint to listen to port and sets receiving host to address:port
int | bind (Port listenPort, IPAddress address, Port sendPort)
int | send (int size)
| sends data from the shared buffer (does no copy of data)
int | send (int size, char *addr, int sPort)
| sends data from the shared buffer to a givern host/port
int | send (void *data, int size)
| sends data to last specified other host (copies the data)
int | send (void *data, int size, char *address, int port)
| sends data to other host
int | send (void *data, int size, IPAddress address, int port)
| sends data to other host
virtual void | onReceive (void *data, int size)
| Called when new data arrives.
virtual void | onClose ()
| Called from close() when connection closes.
virtual void | onSendingDone ()
void | close ()
| Closes Endpoint in case of an error an error.
const char * | getErrorString (UDPEndpointError error)
const char * | getErrorString ()
virtual void | sendCont (antEnvMsg *msg)
virtual void | receiveCont (antEnvMsg *msg)
virtual void | closeCont (antEnvMsg *msg)
## Protected Attributes
IPAddress | ipOfLastPackage
## Private Member Functions
void | startReceiving ()
## Private Attributes
IPAddress | address
Port | sendPort
Port | listenPort

## Detailed Description

static class for system calls

Attention:
  the implementation is system specific!

Definition at line 18 of file UDPEndpoint.h.

## Constructor & Destructor Documentation

UDPEndpoint::UDPEndpoint | ( | int | sendBufferSize = 2048,
|  | int | receiveBufferSize = 2048
| ) |

| Definition at line 16 of file UDPEndpoint.cpp.

UDPEndpoint::~UDPEndpoint | ( |  | ) |

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

Here is the call graph for this function:

## Member Function Documentation

int UDPEndpoint::bind | ( | int | listenPort | ) |

| binds endpoint to listen to port Definition at line 39 of file UDPEndpoint.cpp. References getErrorString(), listenPort, and startReceiving(). Referenced by bind(), BroadCastStatusHandler::initBroadCastStatusHandler(), DDPHandler::initDDPHandler(), GTCamHandler::initGTCamHandler(), GTCamTimeSyncHandler::initGTCamTimeSyncHandler(), UDPHandler::start(), and UDPBroadcastHandler::start().

Here is the call graph for this function:

int UDPEndpoint::bind | ( | int | listenPort,
|  | char * | address,
|  | int | sendPort
| ) |

| binds endpoint to listen to port and sets receiving host to address:port Definition at line 65 of file UDPEndpoint.cpp. References bind(), and sendPort.

Here is the call graph for this function:

int UDPEndpoint::bind | ( | Port | listenPort,
|  | IPAddress | address,
|  | Port | sendPort
| ) |

| Definition at line 56 of file UDPEndpoint.cpp. References bind(), and sendPort.

Here is the call graph for this function:

int UDPEndpoint::send | ( | int | size | ) |

| sends data from the shared buffer (does no copy of data) Definition at line 82 of file UDPEndpoint.cpp. References sendPort. Referenced by send(), DDPHandler::sendDDPPackage(), UDPHandlerEndpoint::sendPackage(), BroadCastStatusHandler::sendStatusPackage(), and GTCamTimeSyncHandler::startTimeSync().

int UDPEndpoint::send | ( | int | size,
|  | char * | addr,
|  | int | sPort
| ) |

| sends data from the shared buffer to a givern host/port Definition at line 90 of file UDPEndpoint.cpp. References send(), and sendPort.

Here is the call graph for this function:

int UDPEndpoint::send | ( | void * | data,
|  | int | size
| ) |

| sends data to last specified other host (copies the data) Definition at line 74 of file UDPEndpoint.cpp. References send().

Here is the call graph for this function:

int UDPEndpoint::send | ( | void * | data,
|  | int | size,
|  | char * | address,
|  | int | port
| ) |

| sends data to other host Definition at line 99 of file UDPEndpoint.cpp. References send(), and sendPort.

Here is the call graph for this function:

int UDPEndpoint::send | ( | void * | data,
|  | int | size,
|  | IPAddress | address,
|  | int | port
| ) |

| sends data to other host Definition at line 107 of file UDPEndpoint.cpp. References send(), and sendPort.

Here is the call graph for this function:

void UDPEndpoint::onReceive | ( | void * | data,
|  | int | size
| ) | `[virtual]`

| Called when new data arrives. Reimplemented in DDPHandler, GTCamHandler, GTCamTimeSyncHandler, UDPBroadcastHandler, and UDPHandlerEndpoint. Definition at line 134 of file UDPEndpoint.cpp. Referenced by receiveCont().

void UDPEndpoint::onClose | ( |  | ) | `[virtual]`

| Called from close() when connection closes. Definition at line 173 of file UDPEndpoint.cpp. Referenced by close().

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

| Reimplemented in UDPHandlerEndpoint. Definition at line 130 of file UDPEndpoint.cpp. Referenced by sendCont().

void UDPEndpoint::close | ( |  | ) |

| Closes Endpoint in case of an error an error. Definition at line 164 of file UDPEndpoint.cpp. References onClose(). Referenced by ~UDPEndpoint().

Here is the call graph for this function:

const char * UDPEndpoint::getErrorString | ( | UDPEndpointError | error | ) |

| Definition at line 184 of file UDPEndpoint.cpp.

const char* UDPEndpoint::getErrorString | ( |  | ) |

| Referenced by bind(), receiveCont(), and sendCont().

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

| Reimplemented from IPEndpoint. Definition at line 115 of file UDPEndpoint.cpp. References getErrorString(), and onSendingDone().

Here is the call graph for this function:

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

| Reimplemented from IPEndpoint. Definition at line 149 of file UDPEndpoint.cpp. References getErrorString(), ipOfLastPackage, onReceive(), and startReceiving().

Here is the call graph for this function:

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

| Reimplemented from IPEndpoint. Definition at line 177 of file UDPEndpoint.cpp.

void UDPEndpoint::startReceiving | ( |  | ) | `[private]`

| Definition at line 140 of file UDPEndpoint.cpp. Referenced by bind(), and receiveCont().

## Member Data Documentation

IPAddress UDPEndpoint::ipOfLastPackage`[protected]`

| Definition at line 66 of file UDPEndpoint.h. Referenced by receiveCont().

IPAddress UDPEndpoint::address`[private]`

| Definition at line 69 of file UDPEndpoint.h.

Port UDPEndpoint::sendPort`[private]`

| Definition at line 70 of file UDPEndpoint.h. Referenced by bind(), and send().

Port UDPEndpoint::listenPort`[private]`

| Definition at line 71 of file UDPEndpoint.h. Referenced by bind().

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

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