Expose RTT information from ENet

This commit is contained in:
Cameron Gutman committed 2021-05-15 13:58:54 -05:00
1 parent 5feb3b6f90
commit edf1838708
2 files changed
+26

No files matched your search

+20
View File
@@ -1108,6 +1108,26 @@ int sendInputPacketOnControlStream(unsigned char* data, int length) {
return 0;
}
bool LiGetEstimatedRttInfo(uint32_t* estimatedRtt, uint32_t* estimatedRttVariance) {
bool ret = false;
PltLockMutex(&enetMutex);
if (peer != NULL && peer->state == ENET_PEER_STATE_CONNECTED) {
if (estimatedRtt != NULL) {
*estimatedRtt = peer->roundTripTime;
}
if (estimatedRttVariance != NULL) {
*estimatedRttVariance = peer->roundTripTimeVariance;
}
ret = true;
}
PltUnlockMutex(&enetMutex);
return ret;
}
// Starts the control stream
int startControlStream(void) {
int err;