mirror of
https://github.com/yggdrasil-network/yggdrasil-go
synced 2024-11-09 23:20:26 +03:00
Clean up a bit
This commit is contained in:
parent
0c7cf65d27
commit
127b7e311c
@ -34,8 +34,7 @@ type Multicast struct {
|
||||
listeners map[string]*multicastInterface
|
||||
listenPort uint16
|
||||
isOpen bool
|
||||
interfaceMonitor *time.Timer
|
||||
announcer *time.Timer
|
||||
monitor *time.Timer
|
||||
platformhandler *time.Timer
|
||||
}
|
||||
|
||||
@ -47,15 +46,9 @@ type multicastInterface struct {
|
||||
zone string
|
||||
timer *time.Timer
|
||||
interval time.Duration
|
||||
send chan<- beacon
|
||||
stop chan interface{}
|
||||
}
|
||||
|
||||
type beacon struct {
|
||||
llAddr string
|
||||
zone string
|
||||
}
|
||||
|
||||
// Init prepares the multicast interface for use.
|
||||
func (m *Multicast) Init(core *yggdrasil.Core, state *config.NodeState, log *log.Logger, options interface{}) (err error) {
|
||||
m.core = core
|
||||
@ -135,14 +128,10 @@ func (m *Multicast) Stop() error {
|
||||
func (m *Multicast) _stop() error {
|
||||
m.log.Infoln("Stopping multicast module")
|
||||
m.isOpen = false
|
||||
/*
|
||||
if m.monitorInterfaceChanges != nil {
|
||||
m.monitorInterfaceChanges.Stop()
|
||||
for name := range m.listeners {
|
||||
close(m.listeners[name].stop)
|
||||
delete(m.listeners, name)
|
||||
}
|
||||
if m.sendBeacons != nil {
|
||||
m.sendBeacons.Stop()
|
||||
}
|
||||
*/
|
||||
if m.platformhandler != nil {
|
||||
m.platformhandler.Stop()
|
||||
}
|
||||
@ -226,7 +215,7 @@ func (m *Multicast) monitorInterfaceChanges() {
|
||||
}
|
||||
}
|
||||
// Queue the next check.
|
||||
m.interfaceMonitor = time.AfterFunc(time.Second, func() {
|
||||
m.monitor = time.AfterFunc(time.Second, func() {
|
||||
m.Act(m, m.monitorInterfaceChanges)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user