Skip to content
Snippets Groups Projects
Commit f577a9b5 authored by Jono Wenger's avatar Jono Wenger
Browse files

Merge branch 'master' of git.xx.network:elixxir/xxdk-examples into ConnectionServer

parents 30721918 0d2448c3
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ import ( ...@@ -9,6 +9,8 @@ import (
"io/fs" "io/fs"
"io/ioutil" "io/ioutil"
"os" "os"
"os/signal"
"syscall"
"time" "time"
"gitlab.com/elixxir/client/connect" "gitlab.com/elixxir/client/connect"
...@@ -125,7 +127,7 @@ func main() { ...@@ -125,7 +127,7 @@ func main() {
// Create a tracker channel to be notified of network changes // Create a tracker channel to be notified of network changes
connected := make(chan bool, 10) connected := make(chan bool, 10)
// Provide a callback that will be signalled when network health status changes // Provide a callback that will be signalled when network health status changes
baseClient.GetCmix().AddHealthCallback( e2eClient.GetCmix().AddHealthCallback(
func(isConnected bool) { func(isConnected bool) {
connected <- isConnected connected <- isConnected
}) })
...@@ -179,5 +181,17 @@ func main() { ...@@ -179,5 +181,17 @@ func main() {
// Keep app running to receive messages----------------------------------------------- // Keep app running to receive messages-----------------------------------------------
select {} // Wait until the user terminates the program
c := make(chan os.Signal)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)
<-c
err = e2eClient.StopNetworkFollower()
if err != nil {
jww.ERROR.Printf("Failed to stop network follower: %+v", err)
} else {
jww.INFO.Printf("Stopped network follower.")
}
os.Exit(0)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment