diff --git a/src/tunnel/client.rs b/src/tunnel/client.rs index d2fe3ec..ad459f9 100644 --- a/src/tunnel/client.rs +++ b/src/tunnel/client.rs @@ -63,7 +63,15 @@ where W: AsyncWrite + Send + 'static, { pin_mut!(incoming_cnx); - while let Some(Ok((cnx_stream, remote_addr))) = incoming_cnx.next().await { + while let Some(cnx) = incoming_cnx.next().await { + let (cnx_stream, remote_addr) = match cnx { + Ok((cnx_stream, remote_addr)) => (cnx_stream, remote_addr), + Err(err) => { + error!("Error accepting connection: {:?}", err); + continue; + } + }; + let request_id = Uuid::now_v7(); let span = span!( Level::INFO, diff --git a/src/tunnel/server.rs b/src/tunnel/server.rs index 109a545..158c46a 100644 --- a/src/tunnel/server.rs +++ b/src/tunnel/server.rs @@ -205,7 +205,7 @@ where None => break, Some(Err(err)) => { warn!("Error while listening for incoming connections {err:?}"); - break; + continue; } Some(Ok(cnx)) => { if tx.send_timeout(cnx, Duration::from_secs(30)).await.is_err() {