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

Definition at line 128 of file sqmctrl.cc.

References Error(), and str.

Referenced by StartReadReport().

129  {
130  // 125: Operation canceled (bs::error_code(125, bs::system_category))
131  if (error && error!=ba::error::basic_errors::operation_aborted)
132  {
133  ostringstream str;
134  str << "ReadTimeout of " << URL() << " failed: " << error.message() << " (" << error << ")";// << endl;
135  Error(str);
136 
137  PostClose(false);
138  return;
139  }
140 
141  if (!is_open())
142  {
143  // For example: Here we could schedule a new accept if we
144  // would not want to allow two connections at the same time.
145  fValid = false;
146  PostClose(true);
147  return;
148  }
149 
150  // This is called if the deadline has been shifted
151  if (error==ba::error::basic_errors::operation_aborted)
152  return;
153 
154  // Check whether the deadline has passed. We compare the deadline
155  // against the current time since a new asynchronous operation
156  // may have moved the deadline before this actor had a chance
157  // to run.
158  if (fInTimeout.expires_at() > ba::deadline_timer::traits_type::now())
159  return;
160 
161  ostringstream str;
162  str << "No valid answer received from " << URL() << " within " << ceil(fTimeout*1.5) << "ms";
163  Error(str);
164 
165  PostClose(false);
166 
167  fInTimeout.expires_from_now(boost::posix_time::milliseconds(1000));
168  fInTimeout.async_wait(boost::bind(&ConnectionSQM::HandleReadTimeout,
169  this, dummy::error));
170  }
char str[80]
Definition: test_client.c:7
bool fValid
Definition: sqmctrl.cc:33
void HandleReadTimeout(const bs::error_code &error)
Definition: sqmctrl.cc:128
uint16_t fTimeout
Definition: sqmctrl.cc:34
Error()
Definition: HeadersFTM.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function: