예제 #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);
 }
예제 #2
0
 internal ConfiguredTaskAwaitable(Task <TResult> task, bool continueOnCapturedContext)
 {
     this.m_configuredTaskAwaiter = new ConfiguredTaskAwaitable <TResult> .ConfiguredTaskAwaiter(task, continueOnCapturedContext);
 }
예제 #3
0
        private static async Task CallbackRefactored(ConfiguredTaskAwaitable<WebResponse> task)
        {
            var response = await task;

            // Do something with the response.
        }
예제 #4
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(this._listenerTaskEvent).ConfigureAwait(false);
 }