FACT++  1.0
void ConnectionDrive::HandleReceivedReport ( const boost::system::error_code &  err,
size_t  bytes_received 
)
inlineprotected

Definition at line 484 of file cosyctrl.cc.

References Error(), and str.

Referenced by StartReadReport().

485  {
486  // Do not schedule a new read if the connection failed.
487  if (bytes_received==0 || err)
488  {
489  if (err==ba::error::eof)
490  Warn("Connection closed by remote host (cosy).");
491 
492  // 107: Transport endpoint is not connected (bs::error_code(107, bs::system_category))
493  // 125: Operation canceled
494  if (err && err!=ba::error::eof && // Connection closed by remote host
495  err!=ba::error::basic_errors::not_connected && // Connection closed by remote host
496  err!=ba::error::basic_errors::operation_aborted) // Connection closed by us
497  {
498  ostringstream str;
499  str << "Reading from " << URL() << ": " << err.message() << " (" << err << ")";// << endl;
500  Error(str);
501  }
502  PostClose(err!=ba::error::basic_errors::operation_aborted);
503  return;
504  }
505 
506  istream is(&fBuffer);
507 
508  string line;
509  getline(is, line);
510 
511  if (fIsVerbose)
512  Out() << line << endl;
513 
514  StartReadReport();
515 
516  if (line.substr(0, 13)=="DRIVE-STATUS ")
517  {
518  ProcessDriveStatus(line.substr(70));
519  return;
520  }
521 
522  if (line.substr(0, 13)=="STARG-REPORT ")
523  {
524  ProcessStargReport(line.substr(16));
525  return;
526  }
527 
528  if (line.substr(0, 14)=="TPOINT-REPORT ")
529  {
530  ProcessTpointReport(line.substr(17));
531  return;
532  }
533 
534  if (line.substr(0, 13)=="DRIVE-REPORT ")
535  {
536  ProcessDriveReport(line.substr(16));
537  return;
538  }
539  }
ba::streambuf fBuffer
Definition: cosyctrl.cc:90
void PostClose(bool restart=true)
Definition: Connection.cc:125
char str[80]
Definition: test_client.c:7
bool ProcessDriveReport(const string &line)
Definition: cosyctrl.cc:262
void StartReadReport()
Definition: cosyctrl.cc:541
std::ostream & Out()
Definition: Connection.h:51
bool ProcessTpointReport(const string &line)
Definition: cosyctrl.cc:194
std::string URL() const
Definition: Connection.h:151
int Error(const std::string &str)
Definition: MessageImp.h:49
int Warn(const std::string &str)
Definition: MessageImp.h:48
void ProcessDriveStatus(const string &line)
Definition: cosyctrl.cc:134
bool ProcessStargReport(const string &line)
Definition: cosyctrl.cc:139

+ Here is the call graph for this function:

+ Here is the caller graph for this function: