FACT++  1.0
void ConnectionUSB::HandleSentData ( const boost::system::error_code &  error,
size_t   
)
private

Definition at line 203 of file ConnectionUSB.cc.

References Error(), i, and str.

Referenced by AsyncWrite(), and Out().

204 {
205  if (error==ba::error::basic_errors::operation_aborted)
206  return;
207 
208  if (error && error != ba::error::not_connected)
209  {
210  ostringstream str;
211  str << "Writing to " << URL() << ": " << error.message() << " (" << error << ")";// << endl;
212  Error(str);
213 
214  CloseImp(-1);
215  return;
216  }
217 
218  if (error == ba::error::not_connected)
219  {
220  ostringstream msg;
221  msg << n << " bytes could not be sent to " << URL() << " due to missing connection.";
222  Warn(msg);
223  return;
224  }
225 
226  if (--fQueueSize==0)
227  fOutTimeout.cancel();
228 
229 #ifdef DEBUG_TX
230  ostringstream msg;
231  msg << n << " bytes successfully sent to " << URL();
232  Message(msg);
233 #endif
234 
235 #ifdef DEBUG
236  ofstream fout("transmitted.txt", ios::app);
237  fout << Time() << ": ";
238  for (unsigned int i=0; i<fOutQueue.front().size(); i++)
239  fout << hex << setfill('0') << setw(2) << (uint32_t)fOutQueue.front()[i];
240  fout << endl;
241 #endif
242 
244 }
boost::asio::deadline_timer fOutTimeout
Definition: ConnectionUSB.h:38
std::string URL() const
void CloseImp(int64_t delay=0)
int i
Definition: db_dim_client.c:21
Adds some functionality to boost::posix_time::ptime for our needs.
Definition: Time.h:30
char str[80]
Definition: test_client.c:7
size_t fQueueSize
Definition: ConnectionUSB.h:41
int Error(const std::string &str)
Definition: MessageImp.h:49
int Warn(const std::string &str)
Definition: MessageImp.h:48
int Message(const std::string &str)
Definition: MessageImp.h:46
virtual void HandleTransmittedData(size_t)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: