mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 16:36:54 +02:00
force minimum for p_hrc time_point values
This commit is contained in:
parent
2385331075
commit
84ab4fd585
5 changed files with 11 additions and 10 deletions
|
@ -108,7 +108,8 @@ public:
|
||||||
private:
|
private:
|
||||||
void stopSlowStart(); // stops the slow start on loss or timeout
|
void stopSlowStart(); // stops the slow start on loss or timeout
|
||||||
|
|
||||||
p_high_resolution_clock::time_point _lastRCTime; // last rate increase time
|
p_high_resolution_clock::time_point _lastRCTime = p_high_resolution_clock::time_point().min(); // last rate increase time
|
||||||
|
|
||||||
bool _slowStart { true }; // if in slow start phase
|
bool _slowStart { true }; // if in slow start phase
|
||||||
SequenceNumber _slowStartLastAck; // last ACKed seq num
|
SequenceNumber _slowStartLastAck; // last ACKed seq num
|
||||||
bool _loss { false }; // if loss happened since last rate increase
|
bool _loss { false }; // if loss happened since last rate increase
|
||||||
|
|
|
@ -222,7 +222,7 @@ void Connection::recordRetransmission() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Connection::sendACK(bool wasCausedBySyncTimeout) {
|
void Connection::sendACK(bool wasCausedBySyncTimeout) {
|
||||||
static p_high_resolution_clock::time_point lastACKSendTime;
|
static p_high_resolution_clock::time_point lastACKSendTime = p_high_resolution_clock::time_point().min();
|
||||||
auto currentTime = p_high_resolution_clock::now();
|
auto currentTime = p_high_resolution_clock::now();
|
||||||
|
|
||||||
SequenceNumber nextACKNumber = nextACK();
|
SequenceNumber nextACKNumber = nextACK();
|
||||||
|
@ -534,7 +534,7 @@ void Connection::processACK(std::unique_ptr<ControlPacket> controlPacket) {
|
||||||
// This will be the case if it has been longer than the sync interval OR
|
// This will be the case if it has been longer than the sync interval OR
|
||||||
// it looks like they haven't received our ACK2 for this ACK
|
// it looks like they haven't received our ACK2 for this ACK
|
||||||
auto currentTime = p_high_resolution_clock::now();
|
auto currentTime = p_high_resolution_clock::now();
|
||||||
static p_high_resolution_clock::time_point lastACK2SendTime;
|
static p_high_resolution_clock::time_point lastACK2SendTime = p_high_resolution_clock::time_point().min();
|
||||||
|
|
||||||
microseconds sinceLastACK2 = duration_cast<microseconds>(currentTime - lastACK2SendTime);
|
microseconds sinceLastACK2 = duration_cast<microseconds>(currentTime - lastACK2SendTime);
|
||||||
|
|
||||||
|
@ -779,7 +779,7 @@ void Connection::resetReceiveState() {
|
||||||
|
|
||||||
// clear the loss list and _lastNAKTime
|
// clear the loss list and _lastNAKTime
|
||||||
_lossList.clear();
|
_lossList.clear();
|
||||||
_lastNAKTime = p_high_resolution_clock::time_point();
|
_lastNAKTime = p_high_resolution_clock::time_point().min();
|
||||||
|
|
||||||
// the _nakInterval need not be reset, that will happen on loss
|
// the _nakInterval need not be reset, that will happen on loss
|
||||||
|
|
||||||
|
|
|
@ -114,13 +114,13 @@ private:
|
||||||
|
|
||||||
int _nakInterval { -1 }; // NAK timeout interval, in microseconds, set on loss
|
int _nakInterval { -1 }; // NAK timeout interval, in microseconds, set on loss
|
||||||
int _minNAKInterval { 100000 }; // NAK timeout interval lower bound, default of 100ms
|
int _minNAKInterval { 100000 }; // NAK timeout interval lower bound, default of 100ms
|
||||||
p_high_resolution_clock::time_point _lastNAKTime;
|
p_high_resolution_clock::time_point _lastNAKTime = p_high_resolution_clock::time_point().min();
|
||||||
|
|
||||||
bool _hasReceivedHandshake { false }; // flag for receipt of handshake from server
|
bool _hasReceivedHandshake { false }; // flag for receipt of handshake from server
|
||||||
bool _hasReceivedHandshakeACK { false }; // flag for receipt of handshake ACK from client
|
bool _hasReceivedHandshakeACK { false }; // flag for receipt of handshake ACK from client
|
||||||
|
|
||||||
p_high_resolution_clock::time_point _connectionStart; // holds the time_point for creation of this connection
|
p_high_resolution_clock::time_point _connectionStart = p_high_resolution_clock::time_point().min(); // holds the time_point for creation of this connection
|
||||||
p_high_resolution_clock::time_point _lastReceiveTime; // holds the last time we received anything from sender
|
p_high_resolution_clock::time_point _lastReceiveTime = p_high_resolution_clock::time_point().min(); // holds the last time we received anything from sender
|
||||||
bool _isReceivingData { false }; // flag used for expiry of receipt portion of connection
|
bool _isReceivingData { false }; // flag used for expiry of receipt portion of connection
|
||||||
|
|
||||||
LossList _lossList; // List of all missing packets
|
LossList _lossList; // List of all missing packets
|
||||||
|
|
|
@ -42,8 +42,8 @@ private:
|
||||||
std::vector<int> _packetIntervals; // vector of microsecond intervals between packet arrivals
|
std::vector<int> _packetIntervals; // vector of microsecond intervals between packet arrivals
|
||||||
std::vector<int> _probeIntervals; // vector of microsecond intervals between probe pair arrivals
|
std::vector<int> _probeIntervals; // vector of microsecond intervals between probe pair arrivals
|
||||||
|
|
||||||
p_high_resolution_clock::time_point _lastPacketTime; // the time_point when last packet arrived
|
p_high_resolution_clock::time_point _lastPacketTime = p_high_resolution_clock::time_point().min(); // the time_point when last packet arrived
|
||||||
p_high_resolution_clock::time_point _firstProbeTime; // the time_point when first probe in pair arrived
|
p_high_resolution_clock::time_point _firstProbeTime = p_high_resolution_clock::time_point().min(); // the time_point when first probe in pair arrived
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,7 +281,7 @@ void SendQueue::run() {
|
||||||
// if it has been at least 100ms since we last sent a handshake, send another now
|
// if it has been at least 100ms since we last sent a handshake, send another now
|
||||||
|
|
||||||
// hold the time of last send in a static
|
// hold the time of last send in a static
|
||||||
static auto lastSendHandshake = p_high_resolution_clock::time_point();
|
static auto lastSendHandshake = p_high_resolution_clock::time_point().min();
|
||||||
|
|
||||||
static const auto HANDSHAKE_RESEND_INTERVAL_MS = std::chrono::milliseconds(100);
|
static const auto HANDSHAKE_RESEND_INTERVAL_MS = std::chrono::milliseconds(100);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue