mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
WIP have peer actors queue packets, temporarily a single simple FIFO queue with head drop
This commit is contained in:
parent
9834f222db
commit
945930aa2c
6 changed files with 91 additions and 338 deletions
|
@ -67,7 +67,14 @@ func (r *router) init(core *Core) {
|
|||
// FIXME don't block here!
|
||||
p = r.core.peers._newPeer(&r.core.boxPub, &r.core.sigPub, &crypto.BoxSharedKey{}, &self, nil)
|
||||
})
|
||||
p.out = func(packets [][]byte) { r.handlePackets(p, packets) }
|
||||
p.out = func(packets [][]byte) {
|
||||
r.handlePackets(p, packets)
|
||||
r.Act(p, func() {
|
||||
// after the router handle the packets, notify the peer that it's ready for more
|
||||
p.Act(r, p._handleIdle)
|
||||
})
|
||||
}
|
||||
p.Act(r, p._handleIdle)
|
||||
r.out = func(bs []byte) { p.handlePacketFrom(r, bs) }
|
||||
r.nodeinfo.init(r.core)
|
||||
r.core.config.Mutex.RLock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue