mirror of
https://github.com/netbirdio/netbird.git
synced 2025-07-20 07:57:15 +02:00
- Refactor the network monitoring to handle one event and it after return - In the engine restart cancel the upper layer context and the responsibility of the engine stop will be the upper layer - Before triggering a restart, the engine checks whether the state is already down. This helps avoid unnecessary delayed network restart events.
24 lines
381 B
Go
24 lines
381 B
Go
//go:build ios || android
|
|
|
|
package networkmonitor
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
type NetworkMonitor struct {
|
|
}
|
|
|
|
// New creates a new network monitor.
|
|
func New() *NetworkMonitor {
|
|
return &NetworkMonitor{}
|
|
}
|
|
|
|
func (nw *NetworkMonitor) Listen(_ context.Context) error {
|
|
return fmt.Errorf("network monitor not supported on mobile platforms")
|
|
}
|
|
|
|
func (nw *NetworkMonitor) Stop() {
|
|
}
|