mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 06:35:07 +03:00
Allow multicast to be shut down more sanely
This commit is contained in:
parent
00a972b74e
commit
366fe7e772
2 changed files with 113 additions and 118 deletions
|
@ -32,21 +32,14 @@ import (
|
|||
var awdlGoroutineStarted bool
|
||||
|
||||
func (m *Multicast) multicastStarted() {
|
||||
if awdlGoroutineStarted {
|
||||
return
|
||||
}
|
||||
awdlGoroutineStarted = true
|
||||
for {
|
||||
C.StopAWDLBrowsing()
|
||||
for intf := range m.Interfaces() {
|
||||
if intf == "awdl0" {
|
||||
m.log.Infoln("Multicast discovery is using AWDL discovery")
|
||||
C.StartAWDLBrowsing()
|
||||
break
|
||||
}
|
||||
C.StopAWDLBrowsing()
|
||||
for intf := range m.Interfaces() {
|
||||
if intf == "awdl0" {
|
||||
C.StartAWDLBrowsing()
|
||||
break
|
||||
}
|
||||
time.Sleep(time.Minute)
|
||||
}
|
||||
m.platformhandler = time.AfterFunc(time.Minute, m.multicastStarted)
|
||||
}
|
||||
|
||||
func (m *Multicast) multicastReuse(network string, address string, c syscall.RawConn) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue