prompt += " ";
stream() << std::flush;
- handle().write(prompt);
+ v_write(prompt);
promptLen_ = prompt.size();
promptActive_ = true;
}
prefix_ void senf::console::detail::DumbClientReader::v_write(std::string const & data)
{
- handle().write(data);
+ try {
+ handle().write(data);
+ }
+ catch (std::exception & ex) {
+ SENF_LOG(("unexpected failure writing to socket:" << ex.what()));
+ stopClient(); // SUICIDE
+ }
+ catch (...) {
+ SENF_LOG(("unexpected failure writing to socket: unknown exception"));
+ stopClient(); // SUICIDE
+ }
}
prefix_ unsigned senf::console::detail::DumbClientReader::v_width()
prefix_ void senf::console::detail::NoninteractiveClientReader::v_write(std::string const & data)
{
- handle().write(data);
+ try {
+ handle().write(data);
+ }
+ catch (std::exception & ex) {
+ SENF_LOG(("unexpected failure writing to socket:" << ex.what()));
+ stopClient(); // SUICIDE
+ }
+ catch (...) {
+ SENF_LOG(("unexpected failure writing to socket: unknown exception"));
+ stopClient(); // SUICIDE
+ }
}
prefix_ unsigned senf::console::detail::NoninteractiveClientReader::v_width()
#include <boost/iostreams/concepts.hpp>
#include <boost/iostreams/stream.hpp>
#include <set>
+#include <senf/Utils/Logger/SenfLog.hh>
///////////////////////////////ih.p////////////////////////////////////////
class ClientReader
{
public:
+ SENF_LOG_CLASS_AREA();
+
typedef ServerHandle::ClientHandle ClientHandle;
virtual ~ClientReader() = 0;