Commit e0d22154 authored by artificiel's avatar artificiel
Browse files

ClientConnector: passage de "while" a "if" pour eviter le backlog

parent 1ac1e9b2
......@@ -46,20 +46,25 @@ void ClientConnector::threadedFunction()
xyz_receiver_.receive(fresh_mesh);
if (fresh_mesh.getNumVertices()) {
fresh_mesh.removeVertex(0);
}
TS_START("Client::send channel thread");
aggregated_.send(std::move(fresh_mesh));
TS_STOP("Client::send channel thread");
// TODO -- le comportement est voulu (ne laisse pas de trace lors d'un frame vide)
// MAIS -- probleme lorsque le fresh_mesh est vide (filtrer de l'autre cote?)
TS_START("Client::send channel thread");
aggregated_.send(std::move(fresh_mesh));
TS_STOP("Client::send channel thread");
// std::cout << "NEW CLOUD IN THREAD " << client_name_ << "#" << cloud_counter_ << std::endl;
} else {
handle_connection();
// TS_START("Client::sleep()");
// TS_START("Client::sleep()");
// std::this_thread::sleep_for(std::chrono::milliseconds(10));
// TS_STOP("Client::sleep()");
handle_connection();
}
}
}
......@@ -84,7 +89,7 @@ void ClientConnector::setup()
void ClientConnector::receive_mesh()
{
while (aggregated_.tryReceive(last_mesh_)) {
if (aggregated_.tryReceive(last_mesh_)) {
// std::cout << "...NEW FRAME IN THREAD A " << client_name_ << std::endl;
is_new_ = true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment