mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2025-08-18 09:25:49 +00:00
Expose RTT information from ENet
This commit is contained in:
parent
5feb3b6f90
commit
edf1838708
@ -1108,6 +1108,26 @@ int sendInputPacketOnControlStream(unsigned char* data, int length) {
|
|||||||
return 0;
|
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
|
// Starts the control stream
|
||||||
int startControlStream(void) {
|
int startControlStream(void) {
|
||||||
int err;
|
int err;
|
||||||
|
@ -466,6 +466,12 @@ void LiInterruptConnection(void);
|
|||||||
// from the integer passed to the ConnListenerStageXXX callbacks
|
// from the integer passed to the ConnListenerStageXXX callbacks
|
||||||
const char* LiGetStageName(int stage);
|
const char* LiGetStageName(int stage);
|
||||||
|
|
||||||
|
// This function returns an estimate of the current RTT to the host PC obtained via ENet
|
||||||
|
// protocol statistics. This function will fail if the current GFE version does not use
|
||||||
|
// ENet for the control stream (very old versions), or if the ENet peer is not connected.
|
||||||
|
// This function may only be called between LiStartConnection() and LiStopConnection().
|
||||||
|
bool LiGetEstimatedRttInfo(uint32_t* estimatedRtt, uint32_t* estimatedRttVariance);
|
||||||
|
|
||||||
// This function queues a relative mouse move event to be sent to the remote server.
|
// This function queues a relative mouse move event to be sent to the remote server.
|
||||||
int LiSendMouseMoveEvent(short deltaX, short deltaY);
|
int LiSendMouseMoveEvent(short deltaX, short deltaY);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user