예제 #1
0
 void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
 {
     if (e.Client.IsConnected)
     {
         StatusGet();
     }
 }
예제 #2
0
        void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
        {
            Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());

            if (e.Client.IsConnected)
            {
                // Tasks on connect
            }
        }
예제 #3
0
        private void tcpClient_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
        {
            if (e.Client.IsConnected)
            {
                this.isConnected = true;
                foreach (var item in SimplClients)
                {
                    item.Value.Fire(new SimplEventArgs(eElkSimplEventIds.IsConnected, "true", 1));
                }

                foreach (var item in SimplClients)
                {
                    item.Value.Fire(new SimplEventArgs(eElkSimplEventIds.IsRegistered, "true", 1));
                }

                if (this.responseQueueTimer == null)
                {
                    this.responseQueueTimer = new CTimer(ResponseQueueDequeue, null, 0, 100);
                }
                else
                {
                    responseQueueTimer.Reset(0, 100);
                }

                if (this.commandQueueTimer == null)
                {
                    this.commandQueueTimer = new CTimer(CommandQueueDequeue, null, 0, 100);
                }
                else
                {
                    commandQueueTimer.Reset(0, 100);
                }

                this.InitializePanelParameters();
            }
            else if (!e.Client.IsConnected)
            {
                this.SendDebug("Elk Disconnected");
                this.isConnected = false;

                this.commandQueueTimer.Stop();

                this.commandQueue.Clear();

                this.responseQueueTimer.Stop();

                this.responseQueue.Clear();

                foreach (var item in SimplClients)
                {
                    item.Value.Fire(new SimplEventArgs(eElkSimplEventIds.IsRegistered, "false", 0));
                    item.Value.Fire(new SimplEventArgs(eElkSimplEventIds.IsConnected, "false", 0));
                }
            }
        }
        private void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs args)
        {
            if (ConnectFeedback != null)
            {
                ConnectFeedback.FireUpdate();
            }

            if (StatusFeedback != null)
            {
                StatusFeedback.FireUpdate();
            }
        }
예제 #5
0
 void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
 {
     StatusFeedback.FireUpdate();
     ConnectedFeedback.FireUpdate();
     if (e.Client.IsConnected)
     {
         // Tasks on connect
     }
     else
     {
         // Cleanup items from this session
     }
 }
예제 #6
0
        void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
        {
            Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());

            if (e.Client.IsConnected)
            {
                //SubscribeToAttributes();
            }
            else
            {
                // Cleanup items from this session
                _commandQueue.Clear();
                _commandQueueInProgress = false;
            }
        }
예제 #7
0
        void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
        {
            Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());

            if (e.Client.IsConnected)
            {
                // Tasks on connect
            }
            else
            {
                // Cleanup items from this session

                if (SubscriptionTimer != null)
                {
                    SubscriptionTimer.Stop();
                    SubscriptionTimer = null;
                }

                isSubscribed = false;
                CommandQueue.Clear();
                CommandQueueInProgress = false;
            }
        }
예제 #8
0
        void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
        {
            Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());

            if (e.Client.IsConnected)
            {
                OnlineStatus = true;
                OnlineFeedback.FireUpdate();
            }
            else
            {
                OnlineStatus = false;
                OnlineFeedback.FireUpdate();
                if (SubscriptionTimer != null)
                {
                    SubscriptionTimer.Stop();
                    SubscriptionTimer = null;
                }

                isSubscribed = false;
                CommandQueue.Clear();
                CommandQueueInProgress = false;
            }
        }