use std::io;
use std::thread::sleep;
use std::time::Duration;
mod client;
mod listener;
const NAME: &str = "gipc-example-sync";
fn main() -> Result<(), io::Error> {
println!("An example of how gipc works synchronously:");
let listener = std::thread::Builder::new()
.name("listener thread".to_string())
.spawn(listener::main)?;
sleep(Duration::from_secs(1));
let client = std::thread::Builder::new()
.name("client thread".to_string())
.spawn(client::main)?;
listener.join().expect("Couldn't join listener thread");
client.join().expect("Couldn't join client thread");
Ok(())
}