From 561dba59a06d7f7cc5614b1648484e439aebb771 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Thu, 20 Nov 2003 03:38:12 +0000 Subject: [PATCH] Se arregla el bug que hacia que se cuelgue el cliente al desconectarse. --- Server/include/plaqui/server/controlclient.h | 2 +- Server/src/controlclient.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Server/include/plaqui/server/controlclient.h b/Server/include/plaqui/server/controlclient.h index c2e4a28..d046c8f 100644 --- a/Server/include/plaqui/server/controlclient.h +++ b/Server/include/plaqui/server/controlclient.h @@ -67,7 +67,7 @@ namespace Server { SignalErrorReceived error_received; /// Receptor del estado de la planta TODO Temporal. - Receiver receiver; + Receiver* receiver; // Métodos. diff --git a/Server/src/controlclient.cpp b/Server/src/controlclient.cpp index 15b576e..e744d0d 100644 --- a/Server/src/controlclient.cpp +++ b/Server/src/controlclient.cpp @@ -43,7 +43,7 @@ ControlClient::~ControlClient(void) { << ": destructor." << endl; #endif // DEBUG // TODO Temporal: espero que el receiver muera. - receiver.finish(true); + receiver->finish(true); } ControlClient::ControlClient(const string& _host, @@ -57,6 +57,7 @@ ControlClient::ControlClient(const string& _host, socket->connect(host.c_str(), port); host = socket->localhost(); port = socket->localport(); + receiver = new Receiver(7528, host); } void ControlClient::real_run(void) { @@ -73,7 +74,7 @@ void ControlClient::real_run(void) { // TODO sacar signal_connected? connected(); // TODO Temporal: el receiver empieza a escuchar. - receiver.run(); + receiver->run(); while (!stop) { HTTPResponse response; try { @@ -138,7 +139,7 @@ Receiver::SignalFrameReceived& ControlClient::signal_frame_received(void) { // XXX - cuidado, esto puede dar quilombo si no esta protegido por un mutex, // aunque no deberia porque la señal no es llamada hasta que no se empice // la transmision y la señal se conecta antes de pedir la transmision. - return receiver.signal_frame_received(); + return receiver->signal_frame_received(); } } // namespace Server -- 2.43.0