Browse Source

print out number of NACKs

pull/128/head
orignal 10 years ago
parent
commit
df21a067ff
  1. 5
      Streaming.cpp

5
Streaming.cpp

@ -272,6 +272,7 @@ namespace stream
size += 4; // ack Through size += 4; // ack Through
packet[size] = 0; packet[size] = 0;
size++; // NACK count size++; // NACK count
packet[size] = RESEND_TIMEOUT;
size++; // resend delay size++; // resend delay
if (!m_IsOpen) if (!m_IsOpen)
{ {
@ -349,11 +350,11 @@ namespace stream
size += 4; // sequenceNum size += 4; // sequenceNum
htobe32buf (packet + size, lastReceivedSeqn); htobe32buf (packet + size, lastReceivedSeqn);
size += 4; // ack Through size += 4; // ack Through
uint8_t numNacks = 0;
if (lastReceivedSeqn > m_LastReceivedSequenceNumber) if (lastReceivedSeqn > m_LastReceivedSequenceNumber)
{ {
// fill NACKs // fill NACKs
uint8_t * nacks = packet + size + 1; uint8_t * nacks = packet + size + 1;
uint8_t numNacks = 0;
auto nextSeqn = m_LastReceivedSequenceNumber + 1; auto nextSeqn = m_LastReceivedSequenceNumber + 1;
for (auto it: m_SavedPackets) for (auto it: m_SavedPackets)
{ {
@ -384,7 +385,7 @@ namespace stream
p.len = size; p.len = size;
SendPackets (std::vector<Packet *> { &p }); SendPackets (std::vector<Packet *> { &p });
LogPrint ("Quick Ack sent"); LogPrint ("Quick Ack sent. ", (int)numNacks, " NACKs");
} }
void Stream::Close () void Stream::Close ()

Loading…
Cancel
Save