StopSW() public method

public StopSW ( ) : void
return void
Esempio n. 1
0
        async Task FetchAsync()
        {
            try {
                await ProcessAllPackets().ConfigureAwait(false);

                _state.ProcessParser(_parser);
                if (_state.Success)
                {
                    _state.Server.UpdateInfoFromResult(_state.Result);
                }
            } catch (TimeoutException e) {
                /*
                 #if DEBUG
                 * this.Logger().FormattedDebugException(e, "Swallowed");
                 #endif
                 */
                _state.Exception = e;
                _state.Cancel();
            } catch (ObjectDisposedException e) {
                /*
                 #if DEBUG
                 * this.Logger().FormattedDebugException(e, "Swallowed");
                 #endif
                 */
                _state.Exception = e;
                _state.Cancel();
            } catch (Exception e) {
                _state.Exception = e;
                _state.Cancel();
                throw;
            } finally {
                _state.StopSW();
            }
        }
        async Task FetchAsync()
        {
            try {
                var needsChallenge = altGames.None(x => x.Equals(_serverBrowserTag));
                if (needsChallenge)
                {
                    await ProcessChallenge().ConfigureAwait(false);
                }
                else
                {
                    await ProcessMagicPacket().ConfigureAwait(false);
                }
                await ProcessFirstDataPacket().ConfigureAwait(false);
                await ProcessRemainingDataPackets().ConfigureAwait(false);

                _state.ProcessParser(_parser);
                if (_state.Success)
                {
                    _state.Server.UpdateInfoFromResult(_state.Result);
                }
            } catch (TimeoutException e) {
                /*
                 #if DEBUG
                 * this.Logger().FormattedDebugException(e, "Swallowed");
                 #endif
                 */
                _state.Exception = e;
                _state.Cancel();
            } catch (ObjectDisposedException e) {
                /*
                 #if DEBUG
                 * this.Logger().FormattedDebugException(e, "Swallowed");
                 #endif
                 */
                _state.Exception = e;
                _state.Cancel();
            } catch (Exception e) {
                _state.Exception = e;
                _state.Cancel();
                throw;
            } finally {
                _state.StopSW();
            }
        }