From 7e6a23a2a724f8b8a5bef563ec5b1ca7b78493a1 Mon Sep 17 00:00:00 2001 From: Petr Date: Mon, 2 Sep 2024 18:56:02 +0200 Subject: [PATCH] Reset comminication before socket is closed --- libshviotqt/src/rpc/clientconnection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libshviotqt/src/rpc/clientconnection.cpp b/libshviotqt/src/rpc/clientconnection.cpp index c6e2c61a9..2e5ce8a1c 100644 --- a/libshviotqt/src/rpc/clientconnection.cpp +++ b/libshviotqt/src/rpc/clientconnection.cpp @@ -253,6 +253,8 @@ void ClientConnection::closeOrAbort(bool is_abort) shvInfo() << "close connection, abort:" << is_abort; m_checkBrokerConnectedTimer->stop(); if(m_socket) { + m_socket->resetCommunication(); + if(is_abort) abortSocket(); else @@ -439,7 +441,6 @@ void ClientConnection::onSocketConnectedChanged(bool is_connected) } else { shvInfo() << objectName() << "connection id:" << connectionId() << "Socket disconnected from RPC server"; - socket()->resetCommunication(); setState(State::NotConnected); } }