FACT++  1.0
void ConnectionUSB::HandleReconnectTimeout ( const boost::system::error_code &  error)
private

Definition at line 132 of file ConnectionUSB.cc.

References Error(), and str.

Referenced by CloseImp(), and Out().

133 {
134  if (error==ba::error::basic_errors::operation_aborted)
135  return;
136 
137  // 125: Operation canceled (bs::error_code(125, bs::system_category))
138  if (error)
139  {
140  ostringstream str;
141  str << "Reconnect timeout of " << URL() << ": " << error.message() << " (" << error << ")";// << endl;
142  Error(str);
143 
144  CloseImp(-1);
145  return;
146  }
147 
148 
149  if (is_open())
150  {
151  Error("HandleReconnectTimeout - "+URL()+" is already open.");
152  return;
153  }
154 
155  // Check whether the deadline has passed. We compare the deadline
156  // against the current time since a new asynchronous operation
157  // may have moved the deadline before this actor had a chance
158  // to run.
159  if (fConnectTimeout.expires_at() > ba::deadline_timer::traits_type::now())
160  return;
161 
162  // Start trying to reconnect
163  Connect();
164 }
std::string URL() const
void CloseImp(int64_t delay=0)
char str[80]
Definition: test_client.c:7
int Error(const std::string &str)
Definition: MessageImp.h:49
boost::asio::deadline_timer fConnectTimeout
Definition: ConnectionUSB.h:39

+ Here is the call graph for this function:

+ Here is the caller graph for this function: