示例#1
0
文件: Router.cs 项目: wbj808178/netmq
 //  Rollback any message parts that were sent but not yet flushed.
 protected void Rollback()
 {
     if (m_currentOut != null)
     {
         m_currentOut.Rollback();
         m_currentOut = null;
         m_moreOut    = false;
     }
 }
示例#2
0
        //  Remove any half processed messages. Flush unflushed messages.
        //  Call this function when engine disconnect to get rid of leftovers.
        private void CleanPipes()
        {
            if (m_pipe != null)
            {
                //  Get rid of half-processed messages in the out pipe. Flush any
                //  unflushed messages upstream.
                m_pipe.Rollback();
                m_pipe.Flush();

                //  Remove any half-read message from the in pipe.
                while (m_incompleteIn)
                {
                    Msg msg = PullMsg();
                    if (msg == null)
                    {
                        Debug.Assert(!m_incompleteIn);
                        break;
                    }
                    msg.Close();
                }
            }
        }