From: Leandro Lucarella Date: Fri, 5 Dec 2003 14:56:24 +0000 (+0000) Subject: Se agrega un try para tratar de solucionar situaciones en las que el server X-Git-Tag: svn_import~10 X-Git-Url: https://git.llucax.com/z.facultad/75.42/plaqui.git/commitdiff_plain/dea314b92324ad67455bb039e2078652ab0e5824?ds=sidebyside Se agrega un try para tratar de solucionar situaciones en las que el server recibe un SIGPIPE (cuando un cliente se desconecta). --- diff --git a/Server/src/controlserver.cpp b/Server/src/controlserver.cpp index 966e362..a8baf50 100644 --- a/Server/src/controlserver.cpp +++ b/Server/src/controlserver.cpp @@ -96,7 +96,19 @@ void ControlServer::real_run(void) throw() { } void ControlServer::send(const Response& response) { - socket << response << flush; + try { + socket << response << flush; + } catch (const sockerr& e) { + cerr << __FILE__ << "(" << __LINE__ << ") send(): " + << "Socket Error: " << e.operation() << " | serrno = " + << e.serrno() << " | errstr = " << e.errstr() << endl; + } catch (const exception& e) { + cerr << __FILE__ << "(" << __LINE__ << ") send(): " + << "Error: " << e.what() << endl; + } catch (...) { + cerr << __FILE__ << "(" << __LINE__ << ") send(): " + << "Error DESCONOCIDO!!!!!!!!" << endl; + } #ifdef DEBUG cerr << __FILE__ << "(" << __LINE__ << ")" << ": send() Enviado!" << endl;