Skip to content

Commit

Permalink
exit on error, remove debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
r58Playz committed Mar 30, 2024
1 parent 9590b1e commit f54c2d3
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions simple-wisp-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -126,8 +120,6 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {
.header("Sec-WebSocket-Protocol", "wisp-v1")
.body(Empty::<Bytes>::new())?;

println!("{:?}", req);

let (ws, _) = handshake::client(&SpawnExecutor, req, socket).await?;

let (rx, tx) = ws.split(tokio::io::split);
Expand Down Expand Up @@ -218,6 +210,7 @@ async fn main() -> Result<(), Box<dyn Error + Send + Sync>> {

if let Err(err) = out.0? {
println!("\n\nerr: {:?}", err);
exit(1);
}

out.2.into_iter().for_each(|x| x.abort());
Expand Down

0 comments on commit f54c2d3

Please sign in to comment.