Skip to content

Commit

Permalink
Close connection if login phase is timeouted
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr committed Sep 6, 2024
1 parent e427a1d commit 7883c14
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libshviotqt/src/rpc/clientconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,12 @@ void ClientConnection::onSocketConnectedChanged(bool is_connected)
setState(State::BrokerConnected);
}
else {
QTimer::singleShot(cp::RpcDriver::defaultRpcTimeoutMsec(), this, [this] () {
if (state() != State::BrokerConnected) {
// login timeout
close();
}
});
sendHello();
}
}
Expand Down

0 comments on commit 7883c14

Please sign in to comment.