mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 09:47:49 +02:00
Removed engine.Stop
This commit is contained in:
parent
1cf9b143e0
commit
881f078759
@ -39,12 +39,6 @@ var (
|
|||||||
iFaceBlackList[config.IFaceBlackList[i]] = struct{}{}
|
iFaceBlackList[config.IFaceBlackList[i]] = struct{}{}
|
||||||
}
|
}
|
||||||
engine := connection.NewEngine(signalClient, config.StunTurnURLs, config.WgIface, config.WgAddr, iFaceBlackList)
|
engine := connection.NewEngine(signalClient, config.StunTurnURLs, config.WgIface, config.WgAddr, iFaceBlackList)
|
||||||
defer func() {
|
|
||||||
err := engine.Stop()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal(err)
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
|
|
||||||
err = engine.Start(myKey, config.Peers)
|
err = engine.Start(myKey, config.Peers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -46,23 +46,6 @@ func NewEngine(signal *signal.Client, stunsTurns []*ice.URL, wgIface string, wgA
|
|||||||
iFaceBlackList: iFaceBlackList,
|
iFaceBlackList: iFaceBlackList,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (e *Engine) Stop() error {
|
|
||||||
err := iface.Delete()
|
|
||||||
if err != nil {
|
|
||||||
log.Errorf("error while deleting Wireguard interface")
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
err = e.signal.Close()
|
|
||||||
if err != nil {
|
|
||||||
log.Errorf("error while closing a connection to the signal server")
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
for _, c := range e.conns {
|
|
||||||
c.Close() //nolint
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start creates a new tunnel interface and listens to signals from the Signal service.
|
// Start creates a new tunnel interface and listens to signals from the Signal service.
|
||||||
// It also creates an Go routine to handle each peer communication from the config file
|
// It also creates an Go routine to handle each peer communication from the config file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user