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

Definition at line 168 of file ConnectionUSB.cc.

References Error(), and str.

Referenced by Out(), and PostMessage().

169 {
170  if (error==ba::error::basic_errors::operation_aborted)
171  return;
172 
173  // 125: Operation canceled (bs::error_code(125, bs::system_category))
174  if (error)
175  {
176  ostringstream str;
177  str << "Write timeout of " << URL() << ": " << error.message() << " (" << error << ")";// << endl;
178  Error(str);
179 
180  CloseImp(-1);
181  return;
182  }
183 
184  if (!is_open())
185  {
186  // For example: Here we could schedule a new accept if we
187  // would not want to allow two connections at the same time.
188  return;
189  }
190 
191  // Check whether the deadline has passed. We compare the deadline
192  // against the current time since a new asynchronous operation
193  // may have moved the deadline before this actor had a chance
194  // to run.
195  if (fOutTimeout.expires_at() > ba::deadline_timer::traits_type::now())
196  return;
197 
198  Error("fOutTimeout has expired, writing data to "+URL());
199 
200  CloseImp(-1);
201 }
boost::asio::deadline_timer fOutTimeout
Definition: ConnectionUSB.h:38
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

+ Here is the call graph for this function:

+ Here is the caller graph for this function: