Skip to content

Commit

Permalink
Merge pull request #133 from arkedge/kble_gs_graceful_shutdown
Browse files Browse the repository at this point in the history
kble_gsをWebSocketのgracefulな終了に対応させる
  • Loading branch information
KOBA789 authored Apr 19, 2024
2 parents b8b0577 + 0953de5 commit 48a186e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tmtc-c2a/src/kble_gs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ impl Socket {
}
anyhow::Ok(())
};
let res: Result<((), ())> = future::try_join(uplink, downlink).await;
let res = tokio::select! {
res = uplink => res,
res = downlink => res,
};
if let Err(e) = res {
error!("kble socket error: {e}")
}
sink.close().await?;
}
}
}
Expand Down

0 comments on commit 48a186e

Please sign in to comment.