forked from facebookarchive/RakNet
-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
In the release build on Android(-O1 -O2 -O3), a large lag periodically occurs for several seconds, after a while it repeats.
Having spent a lot of time localizing the problem, it came down to the methods: CCRakNetSlidingWindow::ShouldSendACKs and CCRakNetUDT::ShouldSendACKs.
// iphone crashes on comparison between double and int64 http://www.jenkinssoftware.com/forum/index.php?topic=2717.0
if (rto==(CCTimeType) UNSET_TIME_US)
{
// Unknown how long until the remote system will retransmit, so better send right away
return true;
}To solve this, I simply disable optimization for this section.
#pragma clang optimize off
// ----------------------------------------------------------------------------------------------------------------------------
bool ShouldSendACKs(CCTimeType curTime, CCTimeType estimatedTimeToNextTick)
{
CCTimeType rto = GetSenderRTOForACK();
(void) estimatedTimeToNextTick;
// iphone crashes on comparison between double and int64 http://www.jenkinssoftware.com/forum/index.php?topic=2717.0
if (rto==(CCTimeType) UNSET_TIME_US)
{
// Unknown how long until the remote system will retransmit, so better send right away
return true;
}
return curTime >= oldestUnsentAck + SYN;
}
#pragma clang optimize onThe problem is in the versions:
Android NDK r22b, r23, r24, r25, r26, r27
If anyone else is using RakNet on modern platforms, I hope it helped you!
Good luck.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels