Beispiel #1
0
 /// <summary>
 /// Starts the FTP server in the background
 /// </summary>
 public void Start()
 {
     if (_stopped)
         throw new InvalidOperationException("Cannot start a previously stopped FTP server");
     _listenerTask = ExecuteServerListener(_cancellationTokenSource.Token).ConfigureAwait(false);
 }
Beispiel #2
0
 internal ConfiguredTaskAwaitable(Task <TResult> task, bool continueOnCapturedContext)
 {
     this.m_configuredTaskAwaiter = new ConfiguredTaskAwaitable <TResult> .ConfiguredTaskAwaiter(task, continueOnCapturedContext);
 }
Beispiel #3
0
        private static async Task CallbackRefactored(ConfiguredTaskAwaitable<WebResponse> task)
        {
            var response = await task;

            // Do something with the response.
        }
 /// <summary>
 /// Starts the FTP server in the background
 /// </summary>
 public void Start()
 {
     if (_stopped)
         throw new InvalidOperationException("Cannot start a previously stopped FTP server");
     _listenerTask = ExecuteServerListener(this._listenerTaskEvent).ConfigureAwait(false);
 }