示例#1
0
        /// <summary>
        /// Clean up context.
        /// </summary>
        /// <remarks>
        /// Make sure to call base.Cleanup() if you override the method.
        /// </remarks>
        public virtual void Cleanup()
        {
            if (StreamPassedOff)
            {
                return;
            }

            if (Stream != null)
            {
                Stream.Close();
                Stream = null;
                m_sock = null;
            }

            m_currentRequest?.Clear();
            m_currentRequest = null;
            m_currentResponse?.Clear();
            m_currentResponse = null;
            requestsInServiceIDs.Clear();

            FirstRequestLineReceived = false;
            FullRequestReceived      = false;
            FullRequestProcessed     = false;
            MonitorStartMS           = 0;
            StopMonitoring           = true;
            MonitorKeepaliveMS       = 0;
            TriggerKeepalive         = false;

            isSendingResponse = false;

            m_ReceiveBytesLeft = 0;

            contextID = -100;
            m_parser.Clear();
        }