[feat] client robust against server disconnects and better logging on the client
This commit is contained in:
@ -66,14 +66,12 @@ impl Server {
|
||||
tracing::info!("{} connected", conn_ctx.remote_addr);
|
||||
|
||||
while let Ok(Some(stream)) = connection.accept_bidirectional_stream().await {
|
||||
tracing::debug!("{} stream opened: {:?}", conn_ctx.remote_addr, stream);
|
||||
|
||||
let (mut rx, mut tx) = stream.split();
|
||||
|
||||
let conn_ctx = conn_ctx.clone();
|
||||
// spawn a new task for the stream
|
||||
tokio::spawn(async move {
|
||||
tracing::debug!("{} stream opened", conn_ctx.remote_addr);
|
||||
tracing::trace!("{} stream opened", conn_ctx.remote_addr);
|
||||
|
||||
// handle streams
|
||||
while let Ok(Some(data)) = rx.receive().await {
|
||||
|
Reference in New Issue
Block a user