Exemplo n.º 1
0
        protected override void OnDestroy()
        {
            base.OnDestroy();

            bIsWebSocketHandlerOn = false;
            if (wsClient != null)
            {
                wsClient.CloseAsync(System.Net.WebSockets.WebSocketCloseStatus.NormalClosure, "AdSubApp closed", System.Threading.CancellationToken.None).Wait(1000);
                wsClient.Dispose();
                wsClient = null;
            }
            if (WebSocketThread != null)
            {
                WebSocketThread.Dispose();
                WebSocketThread = null;
            }

            bIsHeartBeatThreadOn = false;
            if (HeartBeatThread != null)
            {
                HeartBeatThread.Dispose();
                HeartBeatThread = null;
            }

            bIsProgramControlThreadOn = false;
            bIsProgramLoop            = false;
            if (ProgramControlThread != null)
            {
                ProgramControlThread.Dispose();
                ProgramControlThread = null;
            }

            CActivityManager.GetInstence().FinishAllActivity();
            Settings.RuntimeLog.Info("OnDestroy");
        }
Exemplo n.º 2
0
        protected override void OnDestroy()
        {
            base.OnDestroy();

            bIsHeartBeatThreadOn = false;
            if (HeartBeatThread != null)
            {
                HeartBeatThread.Dispose();
                HeartBeatThread = null;
            }

            CActivityManager.GetInstence().FinishAllActivity();
        }