}
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;