WIP
This commit is contained in:
@@ -98,11 +98,11 @@ func (a *App) Run() error {
|
||||
case e := <-a.multicastCh:
|
||||
a.onMulticastDiscovery(e)
|
||||
case <-stateTicker.C:
|
||||
a.onTick()
|
||||
a.onStateTick()
|
||||
case <-pingTicker.C:
|
||||
a.onPingTicker()
|
||||
a.onPingTick()
|
||||
tickCount++
|
||||
if tickCount == 0 {
|
||||
if tickCount%8 == 0 {
|
||||
a.logNetworkState()
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"vppn/peer/control"
|
||||
)
|
||||
|
||||
func (a *App) onPingTicker() {
|
||||
func (a *App) onPingTick() {
|
||||
now := time.Now().UnixNano()
|
||||
for _, p := range a.peersByIP {
|
||||
if p.Role == control.Client {
|
||||
@@ -8,11 +8,9 @@ import (
|
||||
"vppn/peer/wginterface"
|
||||
)
|
||||
|
||||
func (a *App) onTick() {
|
||||
func (a *App) onStateTick() {
|
||||
wgPeers := a.devPeers()
|
||||
|
||||
now := time.Now().UnixNano()
|
||||
|
||||
for _, wgPeer := range wgPeers {
|
||||
p, ok := a.peersByKey[wgPeer.PublicKey]
|
||||
if !ok {
|
||||
Reference in New Issue
Block a user