Exemplo n.º 1
0
        private void callStateListener(ConnectionStateEnum oldState, ConnectionStateEnum newState)
        {
            if (oldState == newState)
            {
                OnLogging(XmlBlasterLogLevel.WARN, "XmlBlasterAccess", "Same states in transition: " + newState);
                return;
            }

            I_ConnectionStateListener l = this.connectionStateListener;

            if (l != null)
            {
                try
                {
                    if (newState == ConnectionStateEnum.ALIVE)
                    {
                        l.reachedAlive(oldState, this);
                    }
                    else if (newState == ConnectionStateEnum.POLLING)
                    {
                        l.reachedPolling(oldState, this);
                    }
                    else if (newState == ConnectionStateEnum.DEAD)
                    {
                        l.reachedDead(oldState, this);
                    }
                }
                catch (Exception e)
                {
                    OnLogging(XmlBlasterLogLevel.WARN, "" + newState, "User code failed: " + e.ToString());
                }
            }
        }
Exemplo n.º 2
0
        public void reachedPolling(ConnectionStateEnum oldStateBeneath, I_XmlBlasterAccess connection)
        {
            ConnectionStateEnum oldState = this.currentState;

            this.currentState = ConnectionStateEnum.POLLING;
            I_ConnectionStateListener l = this.connectionStateListener;

            if (l != null)
            {
                try
                {
                    l.reachedPolling(oldState, connection);
                }
                catch (Exception e)
                {
                    OnLogging(XmlBlasterLogLevel.WARN, "reachedPolling", "User code failed: " + e.ToString());
                }
            }
            StopPinging();
            StartPolling();
        }
Exemplo n.º 3
0
 public void RegisterConnectionListener(I_ConnectionStateListener connectionStateListener)
 {
     this.connectionStateListener = connectionStateListener;
     this.delegateXb.RegisterConnectionListener(this);
 }