cloud inspecting ...

This commit is contained in:
2024-03-15 19:49:37 +03:00
parent 2b738f6f43
commit 3fa5d9d9df
5 changed files with 29 additions and 15 deletions

View File

@@ -61,6 +61,7 @@ void DispatcherServer::cleanClients() {
piCout << "remove Server by ping timeout" << c->getConnection()->clientId();
PIVector<DispatcherClient *> cscv = c->getClients();
for (auto csc: cscv) {
if (!csc->isPIObject()) piCout << "ACHTUNG! Non-piobject DispatcherClient!";
clients.removeAll(csc);
index_c_clients.remove(csc);
c->removeClient(csc);
@@ -183,12 +184,12 @@ void DispatcherServer::setMaxConnections(uint max_count) {
void DispatcherServer::disconnectClient(DispatcherClient * client) {
PIMutexLocker locker(map_mutex);
if (!clients.contains(client)) {
// piCoutObj << "INVALID client" << client;
return;
}
piCoutObj << "remove ..." << client->clientId();
PIMutexLocker locker(map_mutex);
clients.removeAll(client);
rm_clients.removeAll(client);
CloudServer * cs = index_c_servers.value(client, nullptr);
@@ -219,6 +220,7 @@ void DispatcherServer::disconnectClient(DispatcherClient * client) {
void DispatcherServer::newConnection(PIEthernet * cl) {
PIMutexLocker locker(map_mutex);
if (clients.size() >= max_connections) {
delete cl;
return;
@@ -253,7 +255,6 @@ void DispatcherServer::newConnection(PIEthernet * cl) {
}
});
// piCoutObj << "add client" << client;
PIMutexLocker locker(map_mutex);
clients.push_back(client);
client->start();
}