コード例 #1
0
        //internal RQInteraction Dequeue()
        //{
        //    return m_queue.Dequeue();
        //}

        internal virtual void Enqueue(RQInteraction rqi)
        {
            lock (this.padlock)
            {
                if (m_queue.Count == 0)
                {
                    waitingSinceTicks = DateTime.Now.Ticks;
                }
                m_queue.Enqueue(rqi);
            }
        }
コード例 #2
0
 // the queue allows only the last command exist in the waiting, if a new one comes it becomes the waiting one.
 internal override void Enqueue(RQInteraction rqi)
 {
     lock (this.padlock)
     {
         if (m_queue.Count > 0)
         {
             //Tracer.Trace(Name + " - skipped one");
             m_queue.Clear();
         }
         m_queue.Enqueue(rqi);
     }
 }
コード例 #3
0
 // the queue allows only the last command exist in the waiting, if a new one comes it becomes the waiting one.
 internal override void Enqueue(RQInteraction rqi)
 {
     lock (this.padlock)
     {
         if (m_queue.Count > 0)
         {
             //Tracer.Trace(Name + " - skipped one");
             m_queue.Clear();
         }
         m_queue.Enqueue(rqi);
     }
 }
コード例 #4
0
        internal bool checkForTimeout()
        {
            bool ret = false;

            if (isProcessingInteraction && (DateTime.Now.Ticks - m_currentInteraction.whenSentTicks) / TimeSpan.TicksPerMillisecond > m_currentInteraction.timeoutMs)
            {
                Tracer.Error("RoboteQ timeout on " + m_currentInteraction.toSend);
                m_currentInteraction = null;
                ret = true;
            }

            return(ret);
        }
コード例 #5
0
        internal bool checkForTimeout()
        {
            bool ret = false;

            if (isProcessingInteraction && (DateTime.Now.Ticks - m_currentInteraction.whenSentTicks) / TimeSpan.TicksPerMillisecond > m_currentInteraction.timeoutMs)
            {
                Tracer.Error("RoboteQ timeout on " + m_currentInteraction.toSend);
                m_currentInteraction = null;
                ret = true;
            }

            return ret;
        }
コード例 #6
0
        internal bool onStringReceived(string str, long timestamp)                      // may throw an exception
        {
            bool ret = false;

            lock (this.padlock)
            {
                if (m_currentInteraction != null)
                {
                    m_currentInteraction.received.Add(str);
                    if (m_currentInteraction.received.Count >= m_currentInteraction.linesToExpect)
                    {
                        // last line of the response
                        m_currentInteraction.interpretResponse(timestamp);
                        m_currentInteraction = null;
                        ret = true;
                    }
                }
            }
            return(ret);
        }
コード例 #7
0
 internal string dequeueForSend()
 {
     m_currentInteraction = m_queue.Dequeue();
     m_currentInteraction.whenSentTicks = DateTime.Now.Ticks;
     return(m_currentInteraction.toSend);
 }
コード例 #8
0
 internal string dequeueForSend()
 {
     m_currentInteraction = m_queue.Dequeue();
     m_currentInteraction.whenSentTicks = DateTime.Now.Ticks;
     return m_currentInteraction.toSend;
 }
コード例 #9
0
        // may throw an exception
        internal bool onStringReceived(string str, long timestamp)
        {
            bool ret = false;

            lock (this.padlock)
            {
                if (m_currentInteraction != null)
                {
                    m_currentInteraction.received.Add(str);
                    if (m_currentInteraction.received.Count >= m_currentInteraction.linesToExpect)
                    {
                        // last line of the response
                        m_currentInteraction.interpretResponse(timestamp);
                        m_currentInteraction = null;
                        ret = true;
                    }
                }
            }
            return ret;
        }
コード例 #10
0
 //internal RQInteraction Dequeue()
 //{
 //    return m_queue.Dequeue();
 //}
 internal virtual void Enqueue(RQInteraction rqi)
 {
     lock (this.padlock)
     {
         if (m_queue.Count == 0)
         {
             waitingSinceTicks = DateTime.Now.Ticks;
         }
         m_queue.Enqueue(rqi);
     }
 }