Files
bft-crdt-experiment/side-node/src/main.rs

19 lines
439 B
Rust
Raw Normal View History

2024-05-29 13:17:16 +01:00
use cli::parse_args;
2024-05-29 12:44:52 +01:00
use websockets::{WebSocket, WebSocketError};
2024-05-29 13:17:16 +01:00
pub(crate) mod cli;
2024-05-29 12:44:52 +01:00
#[tokio::main]
async fn main() -> Result<(), WebSocketError> {
2024-05-29 13:17:16 +01:00
parse_args();
2024-05-29 12:44:52 +01:00
let mut ws = WebSocket::connect("ws://localhost:8080/").await?;
ws.send_text("foo".to_string()).await?;
// ws.receive().await?;
// ws.close(None).await?;
loop {
let msg = ws.receive().await?;
println!("Received: {:?}", msg);
}
2024-05-29 08:32:40 +01:00
}