cloud! finally fixed bug!

This commit is contained in:
2024-03-25 22:40:29 +03:00
parent c18d0c918e
commit c7c3852747

View File

@@ -75,7 +75,7 @@ void DispatcherServer::cleanClients() {
c_servers.remove(c->serverUUID());
index_c_servers.remove(c->getConnection());
rmrf_clients << const_cast<DispatcherClient *>(c->getConnection());
delete c;
rmrf_servers << c;
}
}
for (auto c: rm_clients) {
@@ -223,10 +223,10 @@ void DispatcherServer::disconnectClient(DispatcherClient * client) {
void DispatcherServer::newConnection(PIEthernet * cl) {
piCout << "DispatcherServer::newConnection" << (void *)cl;
// piCout << "DispatcherServer::newConnection" << (void *)cl;
PIMutexLocker locker(map_mutex);
if (clients.size() >= max_connections) {
piCout << "DispatcherServer::newConnection overflow" << (void *)cl;
// piCout << "DispatcherServer::newConnection overflow" << (void *)cl;
delete cl;
return;
}
@@ -237,7 +237,7 @@ void DispatcherServer::newConnection(PIEthernet * cl) {
CloudServer * cs = c_servers.value(sname, nullptr);
if (cs) {
rm_clients << c;
piCoutObj << "dublicate Server ->" << sname.toHex();
piCoutObj << "duplicate Server ->" << sname.toHex();
} else {
piCoutObj << "add new Server ->" << sname.toHex();
CloudServer * cs = new CloudServer(c, sname);
@@ -262,5 +262,5 @@ void DispatcherServer::newConnection(PIEthernet * cl) {
// piCoutObj << "add client" << client;
clients.push_back(client);
client->start();
piCout << "DispatcherServer::newConnection started" << (void *)cl;
// piCout << "DispatcherServer::newConnection started" << (void *)cl;
}