private void OnError(ILowProtocol sender, SocketErrorArgs args)
        {
            m_protocol.Enabled     -= OnEnabled;
            m_protocol.SocketError -= OnError;
            m_protocol.Disabled    -= OnDisabled;
            m_protocol.Dispose();

            if (m_response != null)
            {
                m_response(new Error(StatusCode.ConnectionError)
                {
                    Message = args.Message
                });
            }

            m_protocol = null;
            m_call     = null;
            m_response = null;
        }
Exemplo n.º 2
0
 private void Dispose()
 {
     if (m_protocol != null)
     {
         m_protocol.Dispose();
         m_protocol.Enabled     -= OnEnabled;
         m_protocol.Disabled    -= OnDisabled;
         m_protocol.SocketError -= OnSocketError;
         m_protocol.Message     -= OnMessage;
         m_protocol              = null;
     }
 }