Skip to content

Commit

Permalink
fix: Leak in AutoReconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
philippseith committed Nov 18, 2021
1 parent 63fb61e commit e50db63
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,15 @@ func (c *client) run() error {
// Run the loop
err = loop.Run(isLoopConnected)

if err == nil {
err = loop.hubConn.Close("", false) // allowReconnect value is ignored as servers never initiate a connection
}

// Reset conn to allow reconnecting
c.mx.Lock()
c.conn = nil
c.mx.Unlock()

if err != nil {
return err
}
err = loop.hubConn.Close("", false) // allowReconnect value is ignored as servers never initiate a connection

return err
}

Expand Down

0 comments on commit e50db63

Please sign in to comment.