peer: make PingManager.Stop infallible

This commit is contained in:
Keagan McClelland committed 2024-05-21 13:29:31 -07:00
1 parent 94a9baefeb
commit 61191a576d
3 files changed
+7 -13

No files matched your search

+3 -5
View File
@@ -1257,15 +1257,13 @@ func (p *Brontide) Disconnect(reason error) {
p.log.Infof(err.Error())
// Stop PingManager before closing TCP connection.
p.pingManager.Stop()
// Ensure that the TCP connection is properly closed before continuing.
p.cfg.Conn.Close()
close(p.quit)
if err := p.pingManager.Stop(); err != nil {
p.log.Errorf("couldn't stop pingManager during disconnect: %v",
err)
}
}
// String returns the string representation of this peer.