client_.write(data);
}
}
- catch (SystemException & ex) {
- ;
- }
+ catch (...) {}
return n;
}
log << client.handle().peer();
}
catch (senf::SystemException ex) {
- log << "(unknown)";
+ log << "(dead socket)";
}
}));
// THIS DELETES THE CLIENT INSTANCE !!
prompt += " ";
stream() << std::flush;
- v_write(prompt);
promptLen_ = prompt.size();
promptActive_ = true;
+ v_write(prompt);
}
prefix_ void senf::console::detail::DumbClientReader::v_disablePrompt()
try {
handle().write(data);
}
+ catch (senf::ExceptionMixin & ex) {
+ SENF_LOG(("unexpected failure writing to socket:" << ex.message()));
+ try { handle().facet<senf::TCPSocketProtocol>().shutdown(senf::TCPSocketProtocol::ShutRD); }
+ catch (...) {}
+ }
catch (std::exception & ex) {
SENF_LOG(("unexpected failure writing to socket:" << ex.what()));
- stopClient(); // SUICIDE
+ try { handle().facet<senf::TCPSocketProtocol>().shutdown(senf::TCPSocketProtocol::ShutRD); }
+ catch (...) {}
}
catch (...) {
SENF_LOG(("unexpected failure writing to socket: unknown exception"));
- stopClient(); // SUICIDE
+ try { handle().facet<senf::TCPSocketProtocol>().shutdown(senf::TCPSocketProtocol::ShutRD); }
+ catch (...) {}
}
}
try {
handle().write(data);
}
+ catch (senf::ExceptionMixin & ex) {
+ SENF_LOG(("unexpected failure writing to socket:" << ex.message()));
+ try { handle().facet<senf::TCPSocketProtocol>().shutdown(senf::TCPSocketProtocol::ShutRD); }
+ catch (...) {}
+ }
catch (std::exception & ex) {
SENF_LOG(("unexpected failure writing to socket:" << ex.what()));
- stopClient(); // SUICIDE
+ try { handle().facet<senf::TCPSocketProtocol>().shutdown(senf::TCPSocketProtocol::ShutRD); }
+ catch (...) {}
}
catch (...) {
SENF_LOG(("unexpected failure writing to socket: unknown exception"));
- stopClient(); // SUICIDE
+ try { handle().facet<senf::TCPSocketProtocol>().shutdown(senf::TCPSocketProtocol::ShutRD); }
+ catch (...) {}
}
}
// handled gracefully by the ClientReader. We cannot call stop() here, since we are called
// from the client reader callback and that will continue executing after stop() has been
// called. stop() however will delete *this instance ... BANG ...
- handle_.facet<senf::TCPSocketProtocol>().shutdown(senf::TCPSocketProtocol::ShutRD);
+ try { handle_.facet<senf::TCPSocketProtocol>().shutdown(senf::TCPSocketProtocol::ShutRD); }
+ catch (...) {}
}
catch (std::exception & ex) {
std::string msg (ex.what());