TDME2 1.9.121
|
UDP client message. More...
#include <tdme/network/udpclient/UDPClientMessage.h>
Public Types | |
enum | MessageType { MESSAGETYPE_NONE , MESSAGETYPE_CONNECT , MESSAGETYPE_MESSAGE , MESSAGETYPE_ACKNOWLEDGEMENT } |
Public Member Functions | |
~UDPClientMessage () | |
Destructor. More... | |
const uint64_t | getTime () |
const MessageType | getMessageType () |
const uint32_t | getClientId () |
const uint32_t | getMessageId () |
const uint8_t | getRetryCount () |
const int64_t | getRetryTime () |
void | retry () |
Mark message to be resend with increased retry count. More... | |
stringstream * | getFrame () |
void | generate (char message[512], size_t &bytes) |
Generate datagram. More... | |
Static Public Member Functions | |
static UDPClientMessage * | parse (const char message[512], const size_t bytes) |
Parse. More... | |
Private Member Functions | |
UDPClientMessage (const MessageType messageType, const uint32_t clientId, const uint32_t messageId, const uint8_t retries, stringstream *frame) | |
Public constructor. More... | |
Private Attributes | |
friend | UDPClient |
long | time |
uint8_t | retries |
MessageType | messageType |
uint32_t | clientId |
uint32_t | messageId |
stringstream * | frame |
UDP client message.
Definition at line 16 of file UDPClientMessage.h.
enum MessageType |
Enumerator | |
---|---|
MESSAGETYPE_NONE | |
MESSAGETYPE_CONNECT | |
MESSAGETYPE_MESSAGE | |
MESSAGETYPE_ACKNOWLEDGEMENT |
Definition at line 20 of file UDPClientMessage.h.
~UDPClientMessage | ( | ) |
Destructor.
Definition at line 68 of file UDPClientMessage.cpp.
|
private |
Public constructor.
messageType | message type |
clientId | client id |
messageId | message id |
retries | retries |
frame | frame |
Definition at line 58 of file UDPClientMessage.cpp.
void generate | ( | char | message[512], |
size_t & | bytes | ||
) |
Generate datagram.
Definition at line 104 of file UDPClientMessage.cpp.
const uint32_t getClientId | ( | ) |
Definition at line 80 of file UDPClientMessage.cpp.
stringstream * getFrame | ( | ) |
Definition at line 100 of file UDPClientMessage.cpp.
const uint32_t getMessageId | ( | ) |
Definition at line 84 of file UDPClientMessage.cpp.
const UDPClientMessage::MessageType getMessageType | ( | ) |
Definition at line 76 of file UDPClientMessage.cpp.
const uint8_t getRetryCount | ( | ) |
Definition at line 92 of file UDPClientMessage.cpp.
const int64_t getRetryTime | ( | ) |
Definition at line 88 of file UDPClientMessage.cpp.
const uint64_t getTime | ( | ) |
Definition at line 72 of file UDPClientMessage.cpp.
|
static |
Parse.
message[512] | message |
bytes | bytes |
Definition at line 26 of file UDPClientMessage.cpp.
void retry | ( | ) |
Mark message to be resend with increased retry count.
Definition at line 96 of file UDPClientMessage.cpp.
|
private |
Definition at line 99 of file UDPClientMessage.h.
|
private |
Definition at line 101 of file UDPClientMessage.h.
|
private |
Definition at line 100 of file UDPClientMessage.h.
|
private |
Definition at line 98 of file UDPClientMessage.h.
|
private |
Definition at line 97 of file UDPClientMessage.h.
|
private |
Definition at line 96 of file UDPClientMessage.h.
|
private |
Definition at line 17 of file UDPClientMessage.h.