FACT++  1.0
void ConnectionUSB::PostMessage ( const void *  msg,
size_t  s = 0 
)

Definition at line 246 of file ConnectionUSB.cc.

References HandleWriteTimeout().

Referenced by ConnectionEstablished(), and PostMessage().

247 {
248  // This function can be called from a different thread...
249  if (!is_open())
250  return;
251 
252  // ... this is why we have to increase fQueueSize first
253  fQueueSize++;
254 
255  // ... and shift the deadline timer
256  // This is not ideal, because if we are continously
257  // filling the buffer, it will never timeout
259 
260  // Now we can schedule the buffer to be sent
261  AsyncWrite(ba::const_buffers_1(ptr, sz));
262 }
boost::asio::deadline_timer fOutTimeout
Definition: ConnectionUSB.h:38
void AsyncWrite(const boost::asio::const_buffers_1 &buffers)
void AsyncWait(boost::asio::deadline_timer &timer, int millisec, void(ConnectionUSB::*handler)(const boost::system::error_code &))
size_t fQueueSize
Definition: ConnectionUSB.h:41
void HandleWriteTimeout(const boost::system::error_code &error)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: