コード例 #1
0
ファイル: a2300_iface.cpp プロジェクト: ivan33609/A2300
	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);
		}
	}
コード例 #2
0
 /*!
  * 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();
     }
 }