pack ACK sub sequence number manually for control

This commit is contained in:
Stephen Birarda 2015-07-27 17:23:39 -07:00
parent f6fb421bf2
commit 52411bb8ba
4 changed files with 7 additions and 3 deletions

View file

@ -64,7 +64,10 @@ void Connection::sendACK(bool wasCausedBySyncTimeout) {
// reset the ACK packet so we can fill it up and have it figure out what size it is
ackPacket->reset();
// pack in the ACK
// pack in the ACK sub-sequence number
ackPacket->writePrimitive(_currentACKSubSequenceNumber++);
// pack in the ACK number
ackPacket->writePrimitive(nextACKNumber);
// pack in the RTT and variance

View file

@ -44,6 +44,7 @@ private:
SeqNum _largestReceivedSeqNum; // The largest sequence number received from the peer
SeqNum _lastSentACK; // The last sent ACK
SeqNum _lastReceivedAcknowledgedACK; // The last sent ACK that has been acknowledged via an ACK2 from the peer
SeqNum _currentACKSubSequenceNumber; // The current ACK sub-sequence number (used for Acknowledgment of ACKs)
int32_t _rtt; // RTT, in milliseconds
int32_t _rttVariance; // RTT variance

View file

@ -39,7 +39,7 @@ ControlPacket::ControlPacketPair ControlPacket::createPacketPair(quint64 timesta
}
qint64 ControlPacket::localHeaderSize() {
return sizeof(TypeAndSubSequenceNumber);
return sizeof(BitFieldAndControlType);
}
qint64 ControlPacket::totalHeadersSize() const {

View file

@ -24,7 +24,7 @@ namespace udt {
class ControlPacket : public BasePacket {
Q_OBJECT
public:
using TypeAndSubSequenceNumber = uint32_t;
using BitFieldAndControlType = uint32_t;
using ControlPacketPair = std::pair<std::unique_ptr<ControlPacket>, std::unique_ptr<ControlPacket>>;
enum Type : uint16_t {