Don't reconnect when closing connection manually

This commit is contained in:
Tulir Asokan 2023-07-16 02:16:52 +03:00
parent 5d7edac1e8
commit 15fbc4b654

View file

@ -176,6 +176,7 @@ func (r *RPC) startReadingData(rc io.ReadCloser) {
func (r *RPC) CloseConnection() { func (r *RPC) CloseConnection() {
if r.conn != nil { if r.conn != nil {
r.client.Logger.Debug().Msg("Closing connection manually") r.client.Logger.Debug().Msg("Closing connection manually")
r.listenID++
r.stopping = true r.stopping = true
r.conn.Close() r.conn.Close()
r.conn = nil r.conn = nil