mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	Increase multicast interval at startup from 1s to 15s
This commit is contained in:
		
							parent
							
								
									6432eaa9f5
								
							
						
					
					
						commit
						1cd4b6e8dd
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -29,6 +29,7 @@ type Multicast struct {
 | 
			
		|||
	listeners       map[string]*yggdrasil.TcpListener
 | 
			
		||||
	listenPort      uint16
 | 
			
		||||
	isOpen          bool
 | 
			
		||||
	interval        time.Duration
 | 
			
		||||
	announcer       *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()
 | 
			
		||||
	m.listenPort = current.LinkLocalTCPPort
 | 
			
		||||
	m.groupAddr = "[ff02::114]:9001"
 | 
			
		||||
	m.interval = time.Second
 | 
			
		||||
	return nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -245,9 +247,12 @@ func (m *Multicast) announce() {
 | 
			
		|||
			break
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	m.announcer = time.AfterFunc(time.Second*15, func() {
 | 
			
		||||
	m.announcer = time.AfterFunc(m.interval, func() {
 | 
			
		||||
		m.Act(m, m.announce)
 | 
			
		||||
	})
 | 
			
		||||
	if m.interval.Seconds() < 15 {
 | 
			
		||||
		m.interval += time.Second
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *Multicast) listen() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue