176 if (bytes_received==0 || err)
178 if (err==ba::error::eof)
179 Warn(
"Connection closed by remote host.");
183 if (err && err!=ba::error::eof &&
184 err!=ba::error::basic_errors::not_connected &&
185 err!=ba::error::basic_errors::operation_aborted)
188 str <<
"Reading from " << URL() <<
": " << err.message() <<
" (" << err <<
")";
191 PostClose(err!=ba::error::basic_errors::operation_aborted);
198 if (!getline(is, buffer,
'\n'))
200 Error(
"Received message does not contain \\n... closing connection.");
204 buffer = buffer.substr(0, buffer.size()-1);
207 Out() << buffer << endl;
213 Error(
"Received: "+buffer);
218 catch (
const exception &e)
220 Error(
"Parsing NEMA message failed ["+
string(e.what())+
"]");
221 Error(
"Received: "+buffer);
boost::asio::streambuf fBuffer
Adds some functionality to boost::posix_time::ptime for our needs.
bool ParseAnswer(const string &buffer)