diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp index 66851fa8aa7542eea2b69d7d2fbea0f29df6349e..7ab096cfa901074aee77f59791ecd51e31d671b3 100644 --- a/Common/GmshMessage.cpp +++ b/Common/GmshMessage.cpp @@ -786,6 +786,10 @@ public: void Msg::InitializeOnelab(const std::string &name, const std::string &sockname) { #ifdef HAVE_ONELAB2 + if(_onelabClient) { + delete _onelabClient; + _onelabClient = 0; + } if(sockname.empty()){ if(name != "Gmsh"){ // load db from file: FILE *fp = Fopen(name.c_str(), "rb"); @@ -805,7 +809,7 @@ void Msg::InitializeOnelab(const std::string &name, const std::string &sockname) address = ip4_inet_pton(sockname.substr(0,colon).c_str()); port = atoi(sockname.substr(colon+1).c_str()); } - GmshNetworkClient *c = OnelabDatabase::instance()->useAsNetworkClient(address, port, "Gmsh"); + GmshNetworkClient *c = OnelabDatabase::instance()->useAsNetworkClient(address, port, name); if(c == NULL) { Error("Unable to connect ONELAB server"); Exit(1); diff --git a/contrib/onelab2/OnelabServer.h b/contrib/onelab2/OnelabServer.h index 1db3bbae54c3f61a887827163319f50c24e4fd4b..22c82499942ce75e141fe4b853392b2d0fb9ccf8 100644 --- a/contrib/onelab2/OnelabServer.h +++ b/contrib/onelab2/OnelabServer.h @@ -87,8 +87,8 @@ public: } std::map<std::string, bool> clients = p.getClients(); for(std::map<std::string, bool>::const_iterator it = clients.begin(); it != clients.end(); it++) { - std::cout << "send " << p.getName() << " to " << it->first << " from " << client << std::endl; if(it->first == client) continue; + std::cout << "send " << p.getName() << " to " << it->first << " from " << client << std::endl; OnelabLocalNetworkClient *tmp = getClient(it->first); if(tmp == NULL) continue; tmp->updateParameter(pp);