mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-27 21:55:07 +03:00
update admin dot to better handle missing nodes and to direct links towards parent, based on neilalexander's work
This commit is contained in:
parent
625b97c511
commit
87a4af7841
2 changed files with 73 additions and 13 deletions
|
@ -377,6 +377,14 @@ func dumpDHTSize(store map[[32]byte]*Node) {
|
|||
fmt.Printf("DHT min %d / avg %f / max %d\n", min, avg, max)
|
||||
}
|
||||
|
||||
func (n *Node) startUDP(listen string) {
|
||||
n.core.DEBUG_setupAndStartGlobalUDPInterface(listen)
|
||||
}
|
||||
|
||||
func (n *Node) connectUDP(remoteAddr string) {
|
||||
n.core.DEBUG_maybeSendUDPKeys(remoteAddr)
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
var cpuprofile = flag.String("cpuprofile", "", "write cpu profile `file`")
|
||||
|
@ -416,6 +424,22 @@ func main() {
|
|||
}
|
||||
*/
|
||||
startNetwork(kstore)
|
||||
if true {
|
||||
for _, node := range kstore {
|
||||
node.startUDP("localhost:0")
|
||||
node.connectUDP("localhost:12345")
|
||||
break // just 1
|
||||
}
|
||||
for _, node := range kstore {
|
||||
go func() {
|
||||
// Just dump any packets sent to this node
|
||||
for range node.recv {
|
||||
}
|
||||
}()
|
||||
}
|
||||
var block chan struct{}
|
||||
<-block
|
||||
}
|
||||
//time.Sleep(10*time.Second)
|
||||
// Note that testPaths only works if pressure is turend off
|
||||
// Otherwise congestion can lead to routing loops?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue