mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
aquatic_udp: clean ConnectionMap less often
This commit is contained in:
parent
6d834e772d
commit
1f763e63e4
2 changed files with 9 additions and 3 deletions
2
TODO.md
2
TODO.md
|
|
@ -1,7 +1,5 @@
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
* aquatic_udp: clean ConnectionMap less often
|
|
||||||
|
|
||||||
* access lists:
|
* access lists:
|
||||||
* use arc-swap Cache
|
* use arc-swap Cache
|
||||||
* add CI tests
|
* add CI tests
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,8 @@ pub fn run_socket_worker(
|
||||||
|
|
||||||
let timeout = Duration::from_millis(50);
|
let timeout = Duration::from_millis(50);
|
||||||
|
|
||||||
|
let mut iter_counter = 0usize;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
poll.poll(&mut events, Some(timeout))
|
poll.poll(&mut events, Some(timeout))
|
||||||
.expect("failed polling");
|
.expect("failed polling");
|
||||||
|
|
@ -115,7 +117,13 @@ pub fn run_socket_worker(
|
||||||
local_responses.drain(..),
|
local_responses.drain(..),
|
||||||
);
|
);
|
||||||
|
|
||||||
connections.clean();
|
iter_counter += 1;
|
||||||
|
|
||||||
|
if iter_counter == 1000 {
|
||||||
|
connections.clean();
|
||||||
|
|
||||||
|
iter_counter = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue