135 if (bytes_received==0 || err)
137 if (err==ba::error::eof)
138 Warn(
"Connection closed by remote host (FTM).");
142 if (err && err!=ba::error::eof &&
143 err!=ba::error::basic_errors::not_connected &&
144 err!=ba::error::basic_errors::operation_aborted)
147 str <<
"Reading from " <<
URL() <<
": " << err.message() <<
" (" << err <<
")";
150 PostClose(err!=ba::error::basic_errors::operation_aborted);
157 Out() <<
kBold <<
"Received (" << bytes_received <<
", " <<
fBuffer.size() <<
" bytes):" << endl;
158 Out() <<
"-----\n" << string(ba::buffer_cast<const char*>(
fBuffer.data()), bytes_received) <<
"-----\n";
164 getline(is, str,
'\n');
170 case 1:
Out() <<
"ID: " << str << endl;
break;
179 catch (
const exception &e)
181 Error(
"String conversion failed for '"+str+
" ("+e.what()+
")");
void PostClose(bool restart=true)
Adds some functionality to boost::posix_time::ptime for our needs.
boost::asio::streambuf fBuffer
virtual void UpdateDim(const Data &)
int Error(const std::string &str)
int Warn(const std::string &str)
void StartRead(int line=0)