FACT++  1.0
void ConnectionFAD::HandleReadTimeout ( const bs::error_code &  error)
inlineprivate

Definition at line 245 of file fadctrl.cc.

References Error(), and str.

246  {
247  if (error==ba::error::basic_errors::operation_aborted)
248  return;
249 
250  if (error)
251  {
252  ostringstream str;
253  str << "Read timeout of " << URL() << ": " << error.message() << " (" << error << ")";// << endl;
254  Error(str);
255 
256  PostClose(false);
257  return;
258 
259  }
260 
261  if (!is_open())
262  {
263  // For example: Here we could schedule a new accept if we
264  // would not want to allow two connections at the same time.
265  return;
266  }
267 
268  // Check whether the deadline has passed. We compare the deadline
269  // against the current time since a new asynchronous operation
270  // may have moved the deadline before this actor had a chance
271  // to run.
272  if (fInTimeout.expires_at() > ba::deadline_timer::traits_type::now())
273  return;
274 
275  Error("Timeout reading data from "+URL());
276  PostClose(false);
277  }
boost::asio::deadline_timer fInTimeout
Definition: Connection.h:36
void PostClose(bool restart=true)
Definition: Connection.cc:125
char str[80]
Definition: test_client.c:7
std::string URL() const
Definition: Connection.h:151
int Error(const std::string &str)
Definition: MessageImp.h:49

+ Here is the call graph for this function: