コード例 #1
0
ファイル: XmppStream.cs プロジェクト: csfmeridian/jabber-net
 /// <summary>
 /// Listens for connections from the XMPP server and is used for components only.
 /// </summary>
 protected virtual void Accept()
 {
     if ((m_stanzas == null) || (!m_stanzas.Acceptable))
         m_stanzas = StanzaStream.Create(this.Connection, this);
     lock (StateLock)
     {
         this.State = AcceptingState.Instance;
         m_reconnect = ((int)this[Options.RECONNECT_TIMEOUT] >= 0);
     }
     m_stanzas.Accept();
 }
コード例 #2
0
ファイル: XmppStream.cs プロジェクト: csfmeridian/jabber-net
 /// <summary>
 /// Starts connecting to the XMPP server.  This is done asyncronously.
 /// </summary>
 public virtual void Connect()
 {
     this[Options.CURRENT_KEEP_ALIVE] = -1;
     m_stanzas = StanzaStream.Create(this.Connection, this);
     lock (StateLock)
     {
         State = ConnectingState.Instance;
         m_reconnect = ((int)this[Options.RECONNECT_TIMEOUT] >= 0);
     }
     m_stanzas.Connect();
 }
コード例 #3
0
ファイル: XmppStream.cs プロジェクト: csfmeridian/jabber-net
        void IStanzaEventListener.Closed()
        {
            lock (StateLock)
            {
                State = ClosedState.Instance;
                if ((m_stanzas != null) && (!m_stanzas.Acceptable))
                    m_stanzas = null;
                m_sslOn = false;
                m_compressionOn = false;
            }

            if (OnDisconnect != null)
            {
                if (InvokeRequired)
                    CheckedInvoke(OnDisconnect, new object[] { this });
                else
                    OnDisconnect(this);
            }

            TryReconnect();
        }
コード例 #4
0
ファイル: XmppStream.cs プロジェクト: csfmeridian/jabber-net
        void IStanzaEventListener.Errored(Exception ex)
        {
            m_reconnect = false;

            lock (m_stateLock)
            {
                State = ClosedState.Instance;
                if ((m_stanzas != null) && (!m_stanzas.Acceptable))
                    m_stanzas = null;
            }

            if (OnError != null)
            {
                if (InvokeRequired)
                    CheckedInvoke(OnError, new object[] { this, ex });
                else
                    OnError(this, ex);
            }

            // TODO: Figure out what the "good" errors are, and try to
            // reconnect.  There are too many "bad" errors to just let this fly.
            //TryReconnect();
        }
コード例 #5
0
ファイル: MainForm.cs プロジェクト: csfmeridian/jabber-net
 /*
 private void mnuOffline_Click(object sender, EventArgs e)
 {
     if (jc.IsAuthenticated)
         jc.Close();
 }
  */
 void jc_OnConnect(object sender, StanzaStream stream)
 {
     m_err = false;
     m_connected = true;
 }
コード例 #6
0
 private void m_stream_OnConnect(object sender, StanzaStream stream)
 {
     // I think this is right.  Double check.
     rtDebug.Clear();
 }