UDP Network server IO thread.
More...
#include <tdme/network/udpserver/UDPServerIOThread.h>
|
| UDPServerIOThread (const unsigned int id, UDPServer *server, const unsigned int maxCCU) |
| public constructor should be called in TCPServer More...
|
|
virtual void | run () |
| thread program More...
|
|
void | sendMessage (const UDPServerClient *client, const uint8_t messageType, const uint32_t messageId, stringstream *frame, const bool safe, const bool deleteFrame) |
| pushes a message to be send, takes over ownership of frame More...
|
|
void | processAckReceived (UDPServerClient *client, const uint32_t messageId) |
| Processes an acknowlegdement reception. More...
|
|
void | processAckMessages () |
| Clean up timed out safe messages, reissue messages not beeing acknowlegded from client. More...
|
|
| Thread (const string &name, size_t stackSize=2 *1024 *1024) |
| Public constructor. More...
|
|
virtual | ~Thread () |
| Public destructor. More...
|
|
void | join () |
| Blocks caller thread until this thread has been terminated. More...
|
|
void | start () |
| Starts this objects thread. More...
|
|
virtual void | run ()=0 |
| Abstract run() method, should be implemented by subclassed class, will be called after spawn by start() More...
|
|
void | stop () |
| Requests that this thread should be stopped. More...
|
|
bool | isStopRequested () |
| Returns if stop has been requested. More...
|
|
UDP Network server IO thread.
- Author
- Andreas Drewke
Definition at line 34 of file UDPServerIOThread.h.
◆ MessageMapAck
◆ MessageQueue
◆ UDPServerIOThread()
public constructor should be called in TCPServer
- Parameters
-
id | id |
*server | server |
maxCCU | max ccu |
Definition at line 44 of file UDPServerIOThread.cpp.
◆ processAckMessages()
void processAckMessages |
( |
| ) |
|
|
private |
Clean up timed out safe messages, reissue messages not beeing acknowlegded from client.
Definition at line 418 of file UDPServerIOThread.cpp.
◆ processAckReceived()
void processAckReceived |
( |
UDPServerClient * |
client, |
|
|
const uint32_t |
messageId |
|
) |
| |
|
private |
Processes an acknowlegdement reception.
- Parameters
-
client | client |
messageId | message id |
- Exceptions
-
Definition at line 388 of file UDPServerIOThread.cpp.
◆ run()
◆ sendMessage()
void sendMessage |
( |
const UDPServerClient * |
client, |
|
|
const uint8_t |
messageType, |
|
|
const uint32_t |
messageId, |
|
|
stringstream * |
frame, |
|
|
const bool |
safe, |
|
|
const bool |
deleteFrame |
|
) |
| |
|
private |
pushes a message to be send, takes over ownership of frame
- Parameters
-
client | client |
messageType | message type |
messageId | message id |
frame | frame to be send |
safe | safe, requires ack and retransmission |
deleteFrame | delete frame |
- Exceptions
-
Definition at line 313 of file UDPServerIOThread.cpp.
◆ UDPServer
◆ UDPServerClient
◆ id
◆ kem
◆ maxCCU
◆ MESSAGEACK_KEEPTIME
const uint64_t MESSAGEACK_KEEPTIME = 5000L |
|
staticprivate |
◆ MESSAGEACK_RESENDTIMES
const uint64_t MESSAGEACK_RESENDTIMES = {125L, 250L, 500L, 750L, 1000L, 2000L, 5000L} |
|
staticprivate |
◆ MESSAGEACK_RESENDTIMES_TRIES
const int MESSAGEACK_RESENDTIMES_TRIES = 7 |
|
staticprivate |
◆ messageMapAck
◆ messageMapAckMutex
◆ messageQueue
◆ MESSAGEQUEUE_SEND_BATCH_SIZE
const int MESSAGEQUEUE_SEND_BATCH_SIZE = 100 |
|
staticprivate |
◆ messageQueueMutex
◆ server
◆ socket
The documentation for this class was generated from the following files: