예제 #1
0
 void OnConnect(object sender, StanzaStream stream)
 {
     Trace.Call(sender, stream);
 }
예제 #2
0
 /*
 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;
 }
예제 #3
0
 /// <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();
 }
예제 #4
0
 /// <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();
 }
예제 #5
0
        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();
        }
예제 #6
0
        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();
        }
예제 #7
0
 private void jabber_OnConnect(object o, StanzaStream s)
 {
     this.Logger.Info("jabber_OnConnect - Connecting");
     var client = (JabberClient)o;
 }
예제 #8
0
 private void jabberClient_OnConnect(object sender, StanzaStream stream)
 {
 }
예제 #9
0
 private void _OnConnect(object sender, StanzaStream stream)
 {
     IsConnected = true;
 }