add periodic heart beat

This commit is contained in:
2025-08-03 15:05:35 +02:00
parent b9e36d9f8c
commit 206012e72d
6 changed files with 84 additions and 67 deletions
+8 -4
View File
@@ -2,10 +2,7 @@ mod net;
mod types;
mod utils;
use smol::net::UdpSocket;
use std::{
process::exit,
sync::{Arc, RwLock},
};
use std::{process::exit, sync::Arc};
use orx_concurrent_vec::ConcurrentVec;
fn main() -> std::io::Result<()> {
@@ -21,6 +18,13 @@ fn main() -> std::io::Result<()> {
let registration_vector: Arc<ConcurrentVec<types::Registration>> =
Arc::new(orx_concurrent_vec::ConcurrentVec::new());
{
let reg_clone = registration_vector.clone();
std::thread::spawn(move || {
utils::disconnected_cleaner(reg_clone);
});
}
let mut buf: [u8; pea_2_pea::UDP_BUFFER_SIZE] = [0u8; pea_2_pea::UDP_BUFFER_SIZE];
smol::block_on(async {
loop {