Skip to content
Snippets Groups Projects
Commit 7f703173 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

clients of gmshLocalNetworkClient should also be gmshLocalNetworkClients

parent b5d18bb0
Branches
Tags
No related merge requests found
......@@ -12,7 +12,7 @@
class gmshLocalNetworkClient : public onelab::localNetworkClient{
private:
std::vector<onelab::localNetworkClient*> _clients;
std::vector<gmshLocalNetworkClient*> _clients;
public:
gmshLocalNetworkClient(const std::string &name, const std::string &executable,
const std::string &remoteLogin="")
......@@ -20,18 +20,18 @@ class gmshLocalNetworkClient : public onelab::localNetworkClient{
{
addClient(this);
}
void addClient(onelab::localNetworkClient *client)
void addClient(gmshLocalNetworkClient *client)
{
_clients.push_back(client);
}
void removeClient(onelab::localNetworkClient *client)
void removeClient(gmshLocalNetworkClient *client)
{
std::vector<onelab::localNetworkClient*>::iterator it;
std::vector<gmshLocalNetworkClient*>::iterator it;
it = std::find(_clients.begin(), _clients.end(), client);
if(it != _clients.end()) _clients.erase(it);
}
int getNumClients(){ return _clients.size(); }
onelab::localNetworkClient *getClient(int i)
gmshLocalNetworkClient *getClient(int i)
{
if(i >= 0 && i < getNumClients()) return _clients[i];
return 0;
......
......@@ -401,7 +401,7 @@ bool gmshLocalNetworkClient::run()
// subclients; in that case we might want to start from the one after the
// one we read from last, for better load balancing)
bool stop = false, haveData = false;
onelab::localNetworkClient *c = 0;
gmshLocalNetworkClient *c = 0;
for(int i = 0; i < getNumClients(); i++){
if(getExecutable().empty() && !CTX::instance()->solver.listen){
// we stopped listening to the special "Listen" client
......@@ -435,7 +435,7 @@ bool gmshLocalNetworkClient::run()
}
}
if(stop) break;
if(haveData && !receiveMessage()) break;
if(haveData && !c->receiveMessage()) break;
if(c == this && c->getPid() < 0) break;
}
......@@ -443,7 +443,7 @@ bool gmshLocalNetworkClient::run()
// subclients, if any. We do not delete the servers when we disconnect to make
// sure we always delete them, even when we disconnect "uncleanly"
for(int i = 0; i < getNumClients(); i++){
onelab::localNetworkClient *c = getClient(i);
gmshLocalNetworkClient *c = getClient(i);
GmshServer *s = c->getGmshServer();
c->setGmshServer(0);
if(s){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment