another try fix

This commit is contained in:
2024-03-22 22:29:14 +03:00
parent ad7385c21f
commit 02a9bfb76f

View File

@@ -59,6 +59,7 @@ void DispatcherServer::cleanClients() {
for (auto c: ss) { for (auto c: ss) {
if (c->lastPing() > 15.0) { if (c->lastPing() > 15.0) {
piCout << "remove Server by ping timeout" << c->getConnection()->clientId(); piCout << "remove Server by ping timeout" << c->getConnection()->clientId();
c->close();
PIVector<DispatcherClient *> cscv = c->getClients(); PIVector<DispatcherClient *> cscv = c->getClients();
for (auto csc: cscv) { for (auto csc: cscv) {
if (!csc->isPIObject()) piCout << "ACHTUNG! Non-piobject DispatcherClient!"; if (!csc->isPIObject()) piCout << "ACHTUNG! Non-piobject DispatcherClient!";
@@ -68,7 +69,6 @@ void DispatcherServer::cleanClients() {
csc->close(); csc->close();
if (!rmrf_clients.contains(csc)) rmrf_clients << csc; if (!rmrf_clients.contains(csc)) rmrf_clients << csc;
} }
c->close();
c_servers.remove(c->serverUUID()); c_servers.remove(c->serverUUID());
index_c_servers.remove(c->getConnection()); index_c_servers.remove(c->getConnection());
rmrf_clients << const_cast<DispatcherClient *>(c->getConnection()); rmrf_clients << const_cast<DispatcherClient *>(c->getConnection());