This commit is contained in:
Jacob Weaver
2024-12-13 10:23:45 -06:00
commit 6b27e84e4b
38 changed files with 2821 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
[package]
name = "ground"
version = "0.1.0"
edition = "2021"
[dependencies]
rfe.path = "../../rfe"
anyhow.workspace = true
simple_logger = "5.0.0"
log.workspace = true
+30
View File
@@ -0,0 +1,30 @@
#![feature(thread_sleep_until)]
use std::{
thread::sleep_until,
time::{Duration, Instant},
};
use anyhow::Result;
use connector::{Connector, UdpConnector};
use log::*;
use rfe::*;
use simple_logger::SimpleLogger;
fn main() -> Result<()> {
SimpleLogger::new().init().unwrap();
let mut udp = UdpConnector::new("127.0.0.1", 7011, "127.0.0.1", 7010)?;
let mut next_time = Instant::now() + Duration::from_millis(10);
loop {
sleep_until(next_time);
while let Some(msgs) = udp.recv() {
for msg in msgs {
info!("got msg {:?}", msg);
}
}
next_time += Duration::from_millis(10);
}
}