mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-28 22:25:07 +03:00
a couple race fixes and use timer.AfterFunc instead of sleeping goroutines or ticker in a few places
This commit is contained in:
parent
a3d4d8125b
commit
502f2937a9
11 changed files with 66 additions and 98 deletions
|
@ -552,7 +552,7 @@ func (c *Core) DEBUG_addAllowedEncryptionPublicKey(boxStr string) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
func DEBUG_simLinkPeers(p, q *peer) {
|
||||
// Sets q.out() to point to p and starts p.linkLoop()
|
||||
// Sets q.out() to point to p and starts p.start()
|
||||
goWorkers := func(source, dest *peer) {
|
||||
source.linkOut = make(chan []byte, 1)
|
||||
send := make(chan []byte, 1)
|
||||
|
@ -561,7 +561,7 @@ func DEBUG_simLinkPeers(p, q *peer) {
|
|||
send <- bs
|
||||
}
|
||||
}
|
||||
go source.linkLoop()
|
||||
go source.start()
|
||||
go func() {
|
||||
var packets [][]byte
|
||||
for {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue