public async Task Dispose()
        {
            try
            {
                if (_dispose)
                {
                    return;
                }

                _dispose = true;

                HttpLogger?.Dispose();

                await SendText("close");

                webSocket?.Dispose();

                Thread.Sleep(1000);

                ReceiveHttpAction();
            }
            catch (Exception)
            {
            }
        }
Exemple #2
0
        public async Task Dispose()
        {
            try
            {
                if (_dispose)
                {
                    return;
                }

                _dispose = true;

                mDetectionTimer?.Dispose();

                HttpLogger?.Dispose();

                await SendText("close");

                webSocket?.Dispose();

                Thread.Sleep(1000);

                ReceiveHttpAction();
            }
            catch
            {
                //ignore
            }
            finally
            {
                try
                {
                    client.Dispose();
                }
                catch
                {
                    //ignore
                }
            }
        }