BeginListDirectory() public method

Begins an asynchronous operation of retrieving list of files in remote directory.
The method was called after the client was disposed.
public BeginListDirectory ( string path, AsyncCallback asyncCallback, object state, Action listCallback = null ) : IAsyncResult
path string The path.
asyncCallback AsyncCallback The method to be called when the asynchronous write operation is completed.
state object A user-provided object that distinguishes this particular asynchronous write request from other requests.
listCallback Action The list callback.
return IAsyncResult
 private async Task<IEnumerable<SftpFile>> ListRemoteDirectoriesAsync(SftpClient client, string remoteFullName)
 {
     return await Task.Factory.FromAsync<IEnumerable<SftpFile>>((callback, obj) => client.BeginListDirectory(remoteFullName, callback, obj), client.EndListDirectory, null);
 }