mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-10 04:00:37 +00:00
Increase multicast interval at startup from 1s to 15s
This commit is contained in:
parent
6432eaa9f5
commit
1cd4b6e8dd
@ -29,6 +29,7 @@ type Multicast struct {
|
|||||||
listeners map[string]*yggdrasil.TcpListener
|
listeners map[string]*yggdrasil.TcpListener
|
||||||
listenPort uint16
|
listenPort uint16
|
||||||
isOpen bool
|
isOpen bool
|
||||||
|
interval time.Duration
|
||||||
announcer *time.Timer
|
announcer *time.Timer
|
||||||
platformhandler *time.Timer
|
platformhandler *time.Timer
|
||||||
}
|
}
|
||||||
@ -42,6 +43,7 @@ func (m *Multicast) Init(core *yggdrasil.Core, state *config.NodeState, log *log
|
|||||||
current := m.config.GetCurrent()
|
current := m.config.GetCurrent()
|
||||||
m.listenPort = current.LinkLocalTCPPort
|
m.listenPort = current.LinkLocalTCPPort
|
||||||
m.groupAddr = "[ff02::114]:9001"
|
m.groupAddr = "[ff02::114]:9001"
|
||||||
|
m.interval = time.Second
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,9 +247,12 @@ func (m *Multicast) announce() {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m.announcer = time.AfterFunc(time.Second*15, func() {
|
m.announcer = time.AfterFunc(m.interval, func() {
|
||||||
m.Act(m, m.announce)
|
m.Act(m, m.announce)
|
||||||
})
|
})
|
||||||
|
if m.interval.Seconds() < 15 {
|
||||||
|
m.interval += time.Second
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Multicast) listen() {
|
func (m *Multicast) listen() {
|
||||||
|
Loading…
Reference in New Issue
Block a user