Yggdrasil demo: Add Stop functions
MODIFY
build/gobind/monolith.go
build/gobind/monolith.go
@@ -180,3 +180,10 @@ func (m *DendriteMonolith) Start(staticPeer string, enableMulticast bool) {
logger.Fatal(httpServer.Serve(m.listener))
}()
}
+
+func (m *DendriteMonolith) Stop() {
+ if err := m.listener.Close(); err != nil {
+ logrus.Warn("Error stopping listener:", err)
+ }
+ m.YggdrasilNode.Stop()
+}

MODIFY
cmd/dendrite-demo-yggdrasil/yggconn/node.go
cmd/dendrite-demo-yggdrasil/yggconn/node.go
@@ -156,6 +156,13 @@ func Setup(instanceName, instancePeer, storageDirectory string, enableMulticast
return n, nil
}
+func (n *Node) Stop() {
+ if err := n.multicast.Stop(); err != nil {
+ n.log.Println("Error stopping multicast:", err)
+ }
+ n.core.Stop()
+}
+
func (n *Node) DerivedServerName() string {
return hex.EncodeToString(n.SigningPublicKey())
}

Yggdrasil demo: Add Stop functions