use lightyear::transport::io::TransportConfig; use shared::SERVER_PORT; use std::net::Ipv4Addr; use std::net::SocketAddr; use std::thread; mod client; mod protocol; mod server; mod shared; fn main() { let (from_server_send, from_server_recv) = crossbeam_channel::unbounded(); let (to_server_send, to_server_recv) = crossbeam_channel::unbounded(); thread::spawn(|| { let server_addr = SocketAddr::new(Ipv4Addr::new(0, 0, 0, 0).into(), SERVER_PORT); server::main(TransportConfig::Channels { channels: [(server_addr, to_server_recv, from_server_send)].to_vec(), }); }); client::main(TransportConfig::LocalChannel { recv: from_server_recv, send: to_server_send, }); }