This commit is contained in:
2020-08-27 19:40:11 +03:00
parent e1f2c90790
commit 234d4e73be
9 changed files with 101 additions and 20 deletions

View File

@@ -28,6 +28,7 @@ void DispatcherServer::printStatus() {
auto it = c_servers.makeIterator();
while(it.next()){
piCout << " " << it.key();
it.value()->printStatus();
}
map_mutex.unlock();
}
@@ -50,6 +51,13 @@ void DispatcherServer::newConnection(PIEthernet *cl) {
c_servers.insert(sname, new CloudServer(c));
map_mutex.unlock();
});
CONNECTL(client, registerClient, [this](PIString sname, DispatcherClient * c){
map_mutex.lock();
if (c_servers.contains(sname)) {
c_servers[sname]->addClient(c);
}
map_mutex.unlock();
});
piCoutObj << "add client" << client;
map_mutex.lock();
clients.push_back(client);