Skip to content

Commit 17990ea

Browse files
author
Neil Tallim
committed
Added debug logging for lost packets
1 parent dd6f0fa commit 17990ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/stream/udp.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ pub mod receiver {
233233
self.next_packet_id += 1;
234234
return true;
235235
} else if packet_id > self.next_packet_id { //something was either lost or there's an ordering problem
236-
history.packets_lost += (packet_id - self.next_packet_id) as i64; //assume everything in-between has been lost
236+
let lost_packet_count = (packet_id - self.next_packet_id) as i64;
237+
log::debug!("UDP reception for stream {} observed a gap of {} packets", self.stream_idx, lost_packet_count);
238+
history.packets_lost += lost_packet_count; //assume everything in-between has been lost
237239
self.next_packet_id = packet_id + 1; //anticipate that ordered receipt will resume
238240
} else { //a packet with a previous ID was received; this is either a duplicate or an ordering issue
239241
//CAUTION: this is where the approximation part of the algorithm comes into play

0 commit comments

Comments
 (0)