![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
Stores Responses that want confirmation that they have arrived. More...
#include <SentNetworkThing.h>
Public Member Functions | |
DLLEXPORT | SentResponse (uint32_t sentinpacket, uint32_t messagenumber, RECEIVE_GUARANTEE guarantee, const std::shared_ptr< NetworkResponse > &response) |
DLLEXPORT | SentResponse (uint32_t sentinpacket, uint32_t messagenumber, const NetworkResponse &response) |
This is a variant that can't be resent. More... | |
DLLEXPORT std::string | GetTypeStr () override |
![]() | |
DLLEXPORT | SentNetworkThing (uint32_t packetid, uint32_t messagenumber, RECEIVE_GUARANTEE guarantee) |
DLLEXPORT | ~SentNetworkThing () |
bool | IsFinalized () |
Returns true once the packet has been received by the target or lost too many times. More... | |
DLLEXPORT void | OnFinalized (bool succeeded) |
Called by Connection once this is done. More... | |
DLLEXPORT bool | GetStatus () |
Gets the status once IsFinalized returns true blocks otherwise. More... | |
DLLEXPORT void | SetWaitStatus (bool status) |
Sets the status of the wait object notifying all waiters that this has succeeded or failed. More... | |
DLLEXPORT void | SetAsTimed () |
Sets this packet as a timed packet. More... | |
DLLEXPORT void | ResetStartTime () |
Resets the start time. More... | |
DLLEXPORT void | SetCallback (std::shared_ptr< CallbackType > func=nullptr) |
Binds a callback function that is called either when the packet is successfully sent or it times out. More... | |
DLLEXPORT void | SetCallbackFunc (CallbackType func) |
Public Attributes | |
std::shared_ptr< NetworkResponse > | SentResponseData |
int | StoredType |
Stored for GetTypeStr with non-resendable responses. More... | |
![]() | |
uint32_t | PacketNumber |
Contained in Local packet id. More... | |
const uint32_t | MessageNumber |
RECEIVE_GUARANTEE | Resend = RECEIVE_GUARANTEE::None |
If not RECEIVE_GUARANTEE::None this packet will be resent if considered lost. More... | |
uint8_t | AttemptNumber = 1 |
std::shared_ptr< std::function< void(bool, SentNetworkThing &)> > | Callback |
std::atomic< int64_t > | ConfirmReceiveTime {0} |
The time when this packed got marked as received. More... | |
int64_t | RequestStartTime {0} |
Time this was started. Used to time out this packet and calculate round trip time. More... | |
std::atomic< DONE_STATUS > | IsDone {DONE_STATUS::WAITING} |
Set to true once this object is no longer used. More... | |
Additional Inherited Members | |
![]() | |
enum | DONE_STATUS { DONE_STATUS::WAITING, DONE_STATUS::DONE, DONE_STATUS::FAILED } |
using | CallbackType = std::function< void(bool, SentNetworkThing &)> |
Stores Responses that want confirmation that they have arrived.
Definition at line 123 of file SentNetworkThing.h.
DLLEXPORT SentResponse::SentResponse | ( | uint32_t | sentinpacket, |
uint32_t | messagenumber, | ||
RECEIVE_GUARANTEE | guarantee, | ||
const std::shared_ptr< NetworkResponse > & | response | ||
) |
Definition at line 96 of file SentNetworkThing.cpp.
DLLEXPORT SentResponse::SentResponse | ( | uint32_t | sentinpacket, |
uint32_t | messagenumber, | ||
const NetworkResponse & | response | ||
) |
This is a variant that can't be resent.
Definition at line 102 of file SentNetworkThing.cpp.
|
overridevirtual |
Implements Leviathan::SentNetworkThing.
Definition at line 108 of file SentNetworkThing.cpp.
std::shared_ptr<NetworkResponse> Leviathan::SentResponse::SentResponseData |
Definition at line 134 of file SentNetworkThing.h.
int Leviathan::SentResponse::StoredType |
Stored for GetTypeStr with non-resendable responses.
Definition at line 137 of file SentNetworkThing.h.