more safety cloud_dispatcher
This commit is contained in:
@@ -45,6 +45,9 @@ void DispatcherServer::picoutStatus() {
|
|||||||
|
|
||||||
void DispatcherServer::cleanClients() {
|
void DispatcherServer::cleanClients() {
|
||||||
PIMutexLocker locker(map_mutex);
|
PIMutexLocker locker(map_mutex);
|
||||||
|
for (auto c: rmrf_clients) {
|
||||||
|
if (!c->isPIObject()) piCout << "ACHTUNG! Non-piobject client!";
|
||||||
|
}
|
||||||
piDeleteAllAndClear(rmrf_clients);
|
piDeleteAllAndClear(rmrf_clients);
|
||||||
for (auto c: clients) {
|
for (auto c: clients) {
|
||||||
if (!index_c_servers.contains(c) && !index_c_clients.contains(c)) {
|
if (!index_c_servers.contains(c) && !index_c_clients.contains(c)) {
|
||||||
@@ -62,7 +65,7 @@ void DispatcherServer::cleanClients() {
|
|||||||
index_c_clients.remove(csc);
|
index_c_clients.remove(csc);
|
||||||
c->removeClient(csc);
|
c->removeClient(csc);
|
||||||
csc->close();
|
csc->close();
|
||||||
rmrf_clients << csc;
|
if (!rmrf_clients.contains(csc)) rmrf_clients << csc;
|
||||||
}
|
}
|
||||||
c_servers.remove(c->serverUUID());
|
c_servers.remove(c->serverUUID());
|
||||||
index_c_servers.remove(c->getConnection());
|
index_c_servers.remove(c->getConnection());
|
||||||
@@ -72,7 +75,7 @@ void DispatcherServer::cleanClients() {
|
|||||||
}
|
}
|
||||||
for (auto c: rm_clients) {
|
for (auto c: rm_clients) {
|
||||||
if (clients.contains(c)) {
|
if (clients.contains(c)) {
|
||||||
rmrf_clients << c;
|
if (!rmrf_clients.contains(c)) rmrf_clients << c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (auto c: rmrf_clients) {
|
for (auto c: rmrf_clients) {
|
||||||
@@ -197,7 +200,7 @@ void DispatcherServer::disconnectClient(DispatcherClient * client) {
|
|||||||
index_c_clients.remove(csc);
|
index_c_clients.remove(csc);
|
||||||
cs->removeClient(csc);
|
cs->removeClient(csc);
|
||||||
csc->close();
|
csc->close();
|
||||||
rmrf_clients << csc;
|
if (!rmrf_clients.contains(csc)) rmrf_clients << csc;
|
||||||
}
|
}
|
||||||
c_servers.remove(cs->serverUUID());
|
c_servers.remove(cs->serverUUID());
|
||||||
index_c_servers.remove(client);
|
index_c_servers.remove(client);
|
||||||
|
|||||||
Reference in New Issue
Block a user