/// <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); }
internal ConfiguredTaskAwaitable(Task <TResult> task, bool continueOnCapturedContext) { this.m_configuredTaskAwaiter = new ConfiguredTaskAwaitable <TResult> .ConfiguredTaskAwaiter(task, continueOnCapturedContext); }
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); }