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