31 lines
799 B
Rust
31 lines
799 B
Rust
use bgtu_networks_2_data::SynchronizedServersStorage;
|
|
use bgtu_networks_2_network_abstract::{NetworkContext, NetworkScope};
|
|
use bgtu_networks_2_network_windows::winsocks_scope_2_2;
|
|
use std::sync::Arc;
|
|
use std::thread;
|
|
use bgtu_networks_2_gui_egui::run_eframe_gui;
|
|
|
|
fn main() {
|
|
winsocks_scope_2_2(NetworkMain {});
|
|
}
|
|
|
|
struct NetworkMain {}
|
|
|
|
impl NetworkScope for NetworkMain {
|
|
type R = ();
|
|
|
|
fn run<Ctx: NetworkContext>(self, network: &mut Ctx) -> Self::R {
|
|
let mut storage = Arc::new(SynchronizedServersStorage::<Ctx::Address>::new(10));
|
|
|
|
thread::scope(|s| {
|
|
s.spawn(|| {
|
|
Ctx::run_ping_eventloop(&mut storage.as_ref().new_network_ctx());
|
|
});
|
|
|
|
run_eframe_gui(&mut storage.new_gui_ctx());
|
|
});
|
|
|
|
|
|
}
|
|
}
|