| 83 | } |
| 84 | |
| 85 | int TAckTracker::GetPacketToSend(float deltaT, bool* isCanceled) { |
| 86 | *isCanceled = IsCanceled; |
| 87 | if (IsCanceled) { |
| 88 | return -1; |
| 89 | } |
| 90 | |
| 91 | int res = SelectPacket(); |
| 92 | if (res == -1) { |
| 93 | // needed to count time even if we don't have anything to send |
| 94 | Congestion->ForceTimeAccount(); |
| 95 | return res; |
| 96 | } |
| 97 | Congestion->LaunchPacket(); |
| 98 | PacketsInFly[res] = -deltaT; // deltaT is time since last Step(), so for the timing to be correct we should subtract it |
| 99 | return res; |
| 100 | } |
| 101 | |
| 102 | // called on SendTo() failure |
| 103 | void TAckTracker::AddToResend(int pkt) { |
no test coverage detected