FACT++  1.0
void ConnectionPowerSwitch::HandleRequest ( const bs::error_code &  error)
inlineprivate

Definition at line 179 of file temperature.cc.

References Error(), and str.

Referenced by Request().

180  {
181  // 125: Operation canceled (bs::error_code(125, bs::system_category))
182  if (error && error!=ba::error::basic_errors::operation_aborted)
183  {
184  ostringstream str;
185  str << "Write timeout of " << URL() << ": " << error.message() << " (" << error << ")";// << endl;
186  Error(str);
187 
188  PostClose(false);
189  return;
190  }
191 
192  if (!is_open())
193  {
194  // For example: Here we could schedule a new accept if we
195  // would not want to allow two connections at the same time.
196  PostClose(true);
197  return;
198  }
199 
200  // Check whether the deadline has passed. We compare the deadline
201  // against the current time since a new asynchronous operation
202  // may have moved the deadline before this actor had a chance
203  // to run.
204  if (fKeepAlive.expires_at() > ba::deadline_timer::traits_type::now())
205  return;
206 
207  Request();
208  }
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
boost::asio::deadline_timer fKeepAlive
Definition: temperature.cc:177

+ Here is the call graph for this function:

+ Here is the caller graph for this function: