From f54c2d331520c8151bf1f6882a33ce4f75b20413 Mon Sep 17 00:00:00 2001 From: Toshit Chawda Date: Sat, 30 Mar 2024 10:35:56 -0700 Subject: [PATCH] exit on error, remove debug print --- simple-wisp-client/src/main.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/simple-wisp-client/src/main.rs b/simple-wisp-client/src/main.rs index 39a0f2e..e626b80 100644 --- a/simple-wisp-client/src/main.rs +++ b/simple-wisp-client/src/main.rs @@ -11,13 +11,7 @@ use hyper::{ }; use simple_moving_average::{SingleSumSMA, SMA}; use std::{ - error::Error, - future::Future, - io::{stdout, IsTerminal, Write}, - net::SocketAddr, - sync::Arc, - time::{Duration, Instant}, - usize, + error::Error, future::Future, io::{stdout, IsTerminal, Write}, net::SocketAddr, process::exit, sync::Arc, time::{Duration, Instant}, usize }; use tokio::{ net::TcpStream, @@ -126,8 +120,6 @@ async fn main() -> Result<(), Box> { .header("Sec-WebSocket-Protocol", "wisp-v1") .body(Empty::::new())?; - println!("{:?}", req); - let (ws, _) = handshake::client(&SpawnExecutor, req, socket).await?; let (rx, tx) = ws.split(tokio::io::split); @@ -218,6 +210,7 @@ async fn main() -> Result<(), Box> { if let Err(err) = out.0? { println!("\n\nerr: {:?}", err); + exit(1); } out.2.into_iter().for_each(|x| x.abort());