Exemple #1
0
	void CommitDciMessageBuffer( managed_send_buffer::sptr mbuff, size_t msgLen, bool bAck )
	{
		if( mbuff.get() != NULL)
		{
	    	Dci_Conversation_PrepareMessageHdr( &m_conv, mbuff->cast<Dci_Hdr*>( ), bAck);
	    	mbuff->commit(msgLen);
		}
	}
 /*!
  * The auto flusher ensures that buffers are force committed when
  * the user has not called get_new() within a certain time window.
  */
 void auto_flush(void)
 {
     boost::mutex::scoped_lock lock(_mutex);
     const bool timeout = not _cond.timed_wait(lock, AUTOFLUSH_TIMEOUT);
     if (timeout and _ok_to_auto_flush and _last_send_buff and _bytes_in_buffer != 0)
     {
         _last_send_buff->commit(_bytes_in_buffer);
         _last_send_buff.reset();
     }
 }