Esempio n. 1
0
        /// <summary>
        /// Indicate that the given pipe is now ready for reading.
        /// Pipe calls this on it's sink in response to ProcessActivateRead.
        /// </summary>
        /// <param name="pipe">the pipe to indicate is ready for reading</param>
        public void ReadActivated(Pipe pipe)
        {
            // Skip activating if we're detaching this pipe
            if (m_pipe != pipe)
            {
                Debug.Assert(m_terminatingPipes.Contains(pipe));
                return;
            }

            if (m_engine != null)
            {
                m_engine.ActivateOut();
            }
            else
            {
                m_pipe.CheckRead();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Flush out any leftover messages and call Detached.
        /// </summary>
        public void Detach()
        {
            // Engine is dead. Let's forget about it.
            m_engine = null;

            // Remove any half-done messages from the pipes.
            CleanPipes();

            // Send the event to the derived class.
            Detached();

            // Just in case there's only a delimiter in the pipe.
            m_pipe?.CheckRead();
        }