aboutsummaryrefslogtreecommitdiff
path: root/examples/fullmesh.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-13 17:12:13 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-13 17:12:13 +0200
commit70839d70d86354232f168e63ce4062219acb85c7 (patch)
tree9c956af0339aa048f487c3a4e54c320be8d13647 /examples/fullmesh.rs
parent8dede69dee20b812ad1dcab5b374c60232409f4f (diff)
downloadnetapp-70839d70d86354232f168e63ce4062219acb85c7.tar.gz
netapp-70839d70d86354232f168e63ce4062219acb85c7.zip
Try to handle termination and closing of stuff properly
Diffstat (limited to 'examples/fullmesh.rs')
-rw-r--r--examples/fullmesh.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/fullmesh.rs b/examples/fullmesh.rs
index f40591a..67861a7 100644
--- a/examples/fullmesh.rs
+++ b/examples/fullmesh.rs
@@ -87,6 +87,11 @@ async fn main() {
hex::encode(&privkey.public_key()),
listen_addr);
+ let watch_cancel = netapp::util::watch_ctrl_c();
+
let public_addr = opt.public_addr.map(|x| x.parse().unwrap());
- tokio::join!(netapp.listen(listen_addr, public_addr), peering.run(),);
+ tokio::join!(
+ netapp.listen(listen_addr, public_addr, watch_cancel.clone()),
+ peering.run(watch_cancel),
+ );
}