FACT++  1.0
void ConnectionFSC::HandleRead ( const boost::system::error_code &  err,
size_t  bytes_received 
)
inlineprivate

Definition at line 470 of file fscctrl.cc.

References Error(), HandleReconnectTimeout(), and str.

Referenced by StartRead().

471  {
472  // Do not schedule a new read if the connection failed.
473  if (bytes_received==0 || err)
474  {
475  if (err==ba::error::eof)
476  return;
477 
478  // 107: Transport endpoint is not connected (bs::error_code(107, bs::system_category))
479  // 125: Operation canceled
480  if (err && err!=ba::error::eof && // Connection closed by remote host
481  err!=ba::error::basic_errors::not_connected && // Connection closed by remote host
482  err!=ba::error::basic_errors::operation_aborted) // Connection closed by us
483  {
484  ostringstream str;
485  str << "Reading from " << URL() << ": " << err.message() << " (" << err << ")";// << endl;
486  Error(str);
487  }
488  PostClose(err!=ba::error::basic_errors::operation_aborted);
489  return;
490  }
491 
492  if (!ProcessMessage())
493  {
494  fIsAutoReconnect = true;
495  fReconnectTimeout.expires_from_now(boost::posix_time::seconds(10));
497  this, dummy::error));
498  PostClose(true);
499  return;
500  }
501 
502  StartRead();
503  }
void HandleReconnectTimeout(const bs::error_code &)
Definition: fscctrl.cc:514
char str[80]
Definition: test_client.c:7
boost::asio::deadline_timer fReconnectTimeout
Definition: fscctrl.cc:38
bool ProcessMessage()
Definition: fscctrl.cc:130
void StartRead()
Definition: fscctrl.cc:461
bool fIsAutoReconnect
Definition: fscctrl.cc:33
Error()
Definition: HeadersFTM.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function: