NetMQ.Core.SessionBase.Terminated C# (CSharp) Method

Terminated() public method

This gets called by ProcessPipeTermAck or XTerminated to respond to the termination of the given pipe.
public Terminated ( NetMQ.Core.Pipe pipe ) : void
pipe NetMQ.Core.Pipe the pipe that was terminated
return void
        public void Terminated(Pipe pipe)
        {
            // Drop the reference to the deallocated pipe.
            Debug.Assert(m_pipe == pipe || m_terminatingPipes.Contains(pipe));

            if (m_pipe == pipe)
                // If this is our current pipe, remove it
                m_pipe = null;
            else
                // Remove the pipe from the detached pipes set
                m_terminatingPipes.Remove(pipe);

            if (!IsTerminating && m_options.RawSocket)
            {
                if (m_engine != null)
                {
                    m_engine.Terminate();
                    m_engine = null;
                }
                Terminate();
            }

            // If we are waiting for pending messages to be sent, at this point
            // we are sure that there will be no more messages and we can proceed
            // with termination safely.
            if (m_pending && m_pipe == null && m_terminatingPipes.Count == 0)
                ProceedWithTerm();
        }