mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 16:26:38 +00:00
fix: do Connection.Open() in goroutine to avoid blocking other peers
This commit is contained in:
@@ -89,11 +89,13 @@ func (e *Engine) Start(privateKey string, peers []string) error {
|
||||
conn := NewConnection(*connConfig, signalCandidate, signalOffer, signalAnswer)
|
||||
e.conns[myPubKey] = conn
|
||||
|
||||
err = conn.Open()
|
||||
if err != nil {
|
||||
log.Errorf("error openning connection to a remote peer %s %s", remoteKey.String(), err.Error())
|
||||
return err
|
||||
}
|
||||
go func() {
|
||||
err = conn.Open()
|
||||
if err != nil {
|
||||
log.Errorf("error openning connection to a remote peer %s %s", remoteKey.String(), err.Error())
|
||||
//todo
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user