//! # netpong //! This is pretty silly and only let's your client send "ping" //! over a connection, while letting a server reply pong to //! every connection. But I had to make it for some reason. use anyhow::Result; use libpt::log::*; use tokio; mod client; mod common; mod server; use common::{args::Cli, conf::*}; use crate::{client::Client, server::Server}; #[tokio::main] async fn main() -> Result<()> { let cli = Cli::cli_parse(); debug!("dumping cli args:\n{:#?}", cli); let cfg = Config::build(&cli)?; #[cfg(feature = "server")] if cli.server { info!("starting server"); return Server::build(cfg).await?.run().await; } // implicit else, so we can work without the server feature info!("starting client"); return Client::build(cfg).await?.run().await; }