PICloud many important fixes
This commit is contained in:
@@ -58,7 +58,18 @@ void DispatcherServer::cleanClients() {
|
||||
for (auto c: ss) {
|
||||
if (c->lastPing() > 15.0) {
|
||||
piCout << "remove Server by ping timeout" << c->getConnection()->clientId();
|
||||
PIVector<DispatcherClient *> cscv = c->getClients();
|
||||
for(auto csc : cscv) {
|
||||
clients.removeAll(csc);
|
||||
index_c_clients.remove(csc);
|
||||
c->removeClient(csc);
|
||||
csc->close();
|
||||
rmrf_clients << csc;
|
||||
}
|
||||
c_servers.remove(c->serverUUID());
|
||||
index_c_servers.remove(c->getConnection());
|
||||
rmrf_clients << const_cast<DispatcherClient *>(c->getConnection());
|
||||
delete c;
|
||||
}
|
||||
}
|
||||
for (auto c: rm_clients) {
|
||||
@@ -250,8 +261,8 @@ void DispatcherServer::newConnection(PIEthernet *cl) {
|
||||
map_mutex.unlock();
|
||||
});
|
||||
//piCoutObj << "add client" << client;
|
||||
client->start();
|
||||
map_mutex.lock();
|
||||
clients.push_back(client);
|
||||
map_mutex.unlock();
|
||||
client->start();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user