sleep inside the packet send task instead of outside
This commit is contained in:
parent
aaa530341d
commit
f9ce137c04
1 changed files with 1 additions and 1 deletions
|
|
@ -133,6 +133,7 @@ impl<C: Crypto> Server<C> {
|
||||||
let this = Arc::downgrade(&self);
|
let this = Arc::downgrade(&self);
|
||||||
|
|
||||||
spawn(async move {
|
spawn(async move {
|
||||||
|
sleep(Duration::from_millis(i as u64 * 16)).await;
|
||||||
for n in 0..5 {
|
for n in 0..5 {
|
||||||
let Some(data) = packet_ref.upgrade() else {
|
let Some(data) = packet_ref.upgrade() else {
|
||||||
return;
|
return;
|
||||||
|
|
@ -153,7 +154,6 @@ impl<C: Crypto> Server<C> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
frag_num += 1;
|
frag_num += 1;
|
||||||
sleep(Duration::from_millis(16)).await;
|
|
||||||
}
|
}
|
||||||
drop(inner);
|
drop(inner);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue