map and cloud fix, add cloud debug

This commit is contained in:
2024-02-22 17:10:38 +03:00
parent 7297b9aee0
commit 50bff12364
5 changed files with 29 additions and 48 deletions

View File

@@ -34,12 +34,12 @@ PICloudServer::PICloudServer(const PIString & path, PIIODevice::DeviceMode mode)
opened_ = true;
cvar.notifyOne();
open_mutex.unlock();
// piCoutObj << "connected";
piCoutObj << "connected";
tcp.sendStart();
});
CONNECTL(&eth, disconnected, [this](bool) {
if (is_deleted) return;
// piCoutObj << "disconnected";
piCoutObj << "disconnected";
clients_mutex.lock();
for (auto c: clients_) {
c->is_connected = false;
@@ -89,7 +89,7 @@ PIVector<PICloudServer::Client *> PICloudServer::clients() const {
bool PICloudServer::openDevice() {
// piCout << "PICloudServer open device" << path();
piCoutObj << "open device" << path();
if (is_deleted) return false;
bool op = eth.connect(PINetworkAddress::resolve(path()), false);
if (op) {
@@ -293,12 +293,6 @@ void PICloudServer::clientDeleted(PIObject * o) {
clients_mutex.lock();
clients_.removeOne(c);
removed_clients_.removeAll(c);
auto it = index_clients.makeIterator();
while (it.next()) {
if (it.value() == c) {
index_clients.remove(it.key());
break;
}
}
index_clients.removeWhere([c](uint, Client * v) { return v == c; });
clients_mutex.unlock();
}