FACT++  1.0
void ConnectionAgilent::HandlePowerCycle ( const bs::error_code &  error)
inlineprotected

Definition at line 92 of file agilentctrl.cc.

References Error(), and str.

Referenced by PowerCycle().

93  {
94  // 125: Operation canceled (bs::error_code(125, bs::system_category))
95  if (error && error!=ba::error::basic_errors::operation_aborted)
96  {
97  ostringstream str;
98  str << "Power cycle timeout of " << URL() << ": " << error.message() << " (" << error << ")";// << endl;
99  Error(str);
100 
101  PostClose(false);
102  return;
103  }
104 
105  if (!is_open())
106  {
107  // For example: Here we could schedule a new accept if we
108  // would not want to allow two connections at the same time.
109  PostClose(true);
110  return;
111  }
112 
113  // Check whether the deadline has passed. We compare the deadline
114  // against the current time since a new asynchronous operation
115  // may have moved the deadline before this actor had a chance
116  // to run.
117  if (fTimeout.expires_at() > ba::deadline_timer::traits_type::now())
118  return;
119 
120  SetPower(true);
121  }
void PostClose(bool restart=true)
Definition: Connection.cc:125
char str[80]
Definition: test_client.c:7
bool SetPower(bool on)
Definition: agilentctrl.cc:240
std::string URL() const
Definition: Connection.h:151
int Error(const std::string &str)
Definition: MessageImp.h:49
boost::asio::deadline_timer fTimeout
Definition: agilentctrl.cc:35

+ Here is the call graph for this function:

+ Here is the caller graph for this function: