Skip to content

Commit

Permalink
Removed engine.Stop
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsmaycon committed Jun 25, 2021
1 parent 1cf9b14 commit 881f078
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
6 changes: 0 additions & 6 deletions cmd/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ var (
iFaceBlackList[config.IFaceBlackList[i]] = struct{}{}
}
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)
if err != nil {
Expand Down
17 changes: 0 additions & 17 deletions connection/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,6 @@ func NewEngine(signal *signal.Client, stunsTurns []*ice.URL, wgIface string, wgA
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.
// It also creates an Go routine to handle each peer communication from the config file
Expand Down

0 comments on commit 881f078

Please sign in to comment.