mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
weird scheduler hack, seems to tend to make things more stable without actually locking streams to any particular link
This commit is contained in:
parent
2a76163c7e
commit
691192ff5a
2 changed files with 11 additions and 5 deletions
|
@ -712,10 +712,15 @@ func (t *switchTable) _handleIn(packet []byte, idle map[switchPort]struct{}) boo
|
|||
}
|
||||
}
|
||||
if best != nil {
|
||||
// Send to the best idle next hop
|
||||
delete(idle, best.elem.port)
|
||||
ports[best.elem.port].sendPacketsFrom(t, [][]byte{packet})
|
||||
return true
|
||||
// Tell ourselves to send to this node later
|
||||
// If another (e.g. even better) hop becomes idle in the mean time, it'll take the packet instead
|
||||
// FIXME this is just a hack, but seems to help with stability...
|
||||
go t.Act(nil, func() {
|
||||
t._idleIn(best.elem.port)
|
||||
})
|
||||
//ports[best.elem.port].sendPacketsFrom(t, [][]byte{packet})
|
||||
//return true
|
||||
}
|
||||
// Didn't find anyone idle to send it to
|
||||
return false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue