Beispiel #1
0
        public void Connect(VpnEndpoint endpoint, VpnCredentials credentials, VpnConfig config)
        {
            _vpnEndpoint    = endpoint;
            _vpnCredentials = credentials;
            _config         = config;

            _cancellationHandle.Cancel();
            var cancellationToken = _cancellationHandle.Token;

            _disconnectDelay = Task.Delay(DisconnectDelay, cancellationToken);

            Queued(ScanPorts, cancellationToken);
        }
        protected override async Task <HttpResponseMessage> SendAsync(
            HttpRequestMessage request,
            CancellationToken cancellationToken)
        {
            if (IsLogout(request))
            {
                _cancellationHandle.Cancel();
            }

            return(await base.SendAsync(request,
                                        HasAuthorization(request)?_cancellationHandle.Token : cancellationToken));
        }
Beispiel #3
0
 private void HandleProgressStart()
 {
     _progressStartedAt = DateTime.UtcNow;
     _cancellationHandle.Cancel();
 }