Skip to content

Commit

Permalink
Added debug logging for lost packets
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Tallim committed Sep 20, 2022
1 parent dd6f0fa commit 17990ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/stream/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ pub mod receiver {
self.next_packet_id += 1;
return true;
} else if packet_id > self.next_packet_id { //something was either lost or there's an ordering problem
history.packets_lost += (packet_id - self.next_packet_id) as i64; //assume everything in-between has been lost
let lost_packet_count = (packet_id - self.next_packet_id) as i64;
log::debug!("UDP reception for stream {} observed a gap of {} packets", self.stream_idx, lost_packet_count);
history.packets_lost += lost_packet_count; //assume everything in-between has been lost
self.next_packet_id = packet_id + 1; //anticipate that ordered receipt will resume
} else { //a packet with a previous ID was received; this is either a duplicate or an ordering issue
//CAUTION: this is where the approximation part of the algorithm comes into play
Expand Down

0 comments on commit 17990ea

Please sign in to comment.