private void Unplug()
        {
            Debug.Assert(m_plugged);
            m_plugged = false;

            // remove handle from proactor.
            if (m_ioEnabled)
            {
                m_ioObject.RemoveSocket(m_handle);
                m_ioEnabled = false;
            }

            // Disconnect from I/O threads poller object.
            m_ioObject.Unplug();

            m_state = State.Closed;

            // Disconnect from session object.
            if (m_encoder != null)
            {
                m_encoder.SetMsgSource(null);
            }
            if (m_decoder != null)
            {
                m_decoder.SetMsgSink(null);
            }
            m_session = null;
        }
예제 #2
0
 protected override void ProcessTerm(int linger)
 {
     m_ioObject.SetHandler(this);
     m_ioObject.RemoveSocket(m_handle);
     Close();
     base.ProcessTerm(linger);
 }
예제 #3
0
        protected override void ProcessTerm(int linger)
        {
            if (m_timerStarted)
            {
                m_ioObject.CancelTimer(ReconnectTimerId);
                m_timerStarted = false;
            }

            if (m_handleValid)
            {
                m_ioObject.RemoveSocket(m_s);
                m_handleValid = false;
            }

            if (m_s != null)
            {
                Close();
            }

            base.ProcessTerm(linger);
        }
예제 #4
0
        private void Error()
        {
            Debug.Assert(m_session != null);

            m_session.Detach();

            m_ioObject.RemoveSocket(m_handle);

            // Disconnect from I/O threads poller object.
            m_ioObject.Unplug();

            m_session = null;

            m_state = State.Error;

            Destroy();
        }