Skip to content

Commit 93d0a75

Browse files
committed
send 10 packets to socket 1 and 1 to socket 0
1 parent f10457a commit 93d0a75

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

  • dc/s2n-quic-dc/src/psk

dc/s2n-quic-dc/src/psk/io.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,15 +1158,20 @@ mod tests {
11581158
let packet_socket0 =
11591159
s2n_quic_core::crypto::initial::EXAMPLE_CLIENT_INITIAL_PROTECTED_PACKET;
11601160
while !cancel.load(Ordering::Relaxed) {
1161-
let _ = sender.send_to(&packet_socket1, server_addr);
1161+
// Send 10 packets to socket 1 for every 1 to socket 0.
1162+
// This creates a natural backlog on socket 1,
1163+
// ensuring the priority scheduling has a clear effect.
1164+
for _ in 0..10 {
1165+
let _ = sender.send_to(&packet_socket1, server_addr);
1166+
}
11621167
let _ = sender.send_to(&packet_socket0, server_addr);
1163-
count.fetch_add(2, Ordering::Relaxed);
1168+
count.fetch_add(11, Ordering::Relaxed);
11641169
}
11651170
})
11661171
};
11671172

1168-
// Let the flood run for 1 second
1169-
tokio::time::sleep(Duration::from_secs(1)).await;
1173+
// Let the flood run for 2 second
1174+
tokio::time::sleep(Duration::from_secs(2)).await;
11701175

11711176
// Stop the flood
11721177
cancel.store(true, Ordering::Relaxed);

0 commit comments

Comments
 (0)