X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/blobdiff_plain/751302dd67ffdeb0dfe72c4d2a7a2d58303cf5f3..292425c2f65528535f137b437e629c5785c870d0:/Server/src/tcpserver.cpp?ds=inline diff --git a/Server/src/tcpserver.cpp b/Server/src/tcpserver.cpp index a9ce030..d2bb7fd 100644 --- a/Server/src/tcpserver.cpp +++ b/Server/src/tcpserver.cpp @@ -62,7 +62,9 @@ void PlaQui::Server::TCPServer::on_connection_finished( std::cerr << __FILE__ << ": on_connection_finished(connection = " << connection << ")" << std::endl; #endif // DEBUG - mutex.lock(); + connections_mutex.lock(); + // FIXME pruebo el mutex. + sleep(5); connections.remove(connection); #ifdef DEBUG std::cerr << __FILE__ << ": lista de conexiones" << std::endl; @@ -71,7 +73,7 @@ void PlaQui::Server::TCPServer::on_connection_finished( std::cerr << "\t " << *i << std::endl; } #endif // DEBUG - mutex.unlock(); + connections_mutex.unlock(); } /// \todo TODO: ver tema de timeout o como salir de un accept(). @@ -87,7 +89,9 @@ void PlaQui::Server::TCPServer::real_run(void) { std::cerr << __FILE__ << ": real_run(): connection = " << connection << std::endl; #endif // DEBUG - mutex.lock(); + connections_mutex.lock(); + // FIXME pruebo el mutex. + sleep(5); connections.push_back(connection); #ifdef DEBUG std::cerr << __FILE__ << ": real_run(): lista de conexiones" << std::endl; @@ -96,7 +100,7 @@ void PlaQui::Server::TCPServer::real_run(void) { std::cerr << "\t " << *i << std::endl; } #endif // DEBUG - mutex.unlock(); + connections_mutex.unlock(); // Conecto la señal para cuando termina una conexión, borrarla. connection->signal_finished().connect( SigC::bind(