Middle Proxy Magics

Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
Alexey
2026-02-14 01:51:10 +03:00
parent 70859aa5cf
commit a8c3128c50
4 changed files with 130 additions and 68 deletions

View File

@@ -12,9 +12,11 @@ pub struct ConnRegistry {
impl ConnRegistry {
pub fn new() -> Self {
// Avoid fully predictable conn_id sequence from 1.
let start = rand::random::<u64>() | 1;
Self {
map: RwLock::new(HashMap::new()),
next_id: AtomicU64::new(1),
next_id: AtomicU64::new(start),
}
}