CommandAsyncResult.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Threading;
  3. namespace Renci.SshNet
  4. {
  5. /// <summary>
  6. /// Provides additional information for asynchronous command execution.
  7. /// </summary>
  8. public class CommandAsyncResult : IAsyncResult
  9. {
  10. /// <summary>
  11. /// Initializes a new instance of the <see cref="CommandAsyncResult"/> class.
  12. /// </summary>
  13. internal CommandAsyncResult()
  14. {
  15. }
  16. /// <summary>
  17. /// Gets or sets the bytes received. If SFTP only file bytes are counted.
  18. /// </summary>
  19. /// <value>Total bytes received.</value>
  20. public int BytesReceived { get; set; }
  21. /// <summary>
  22. /// Gets or sets the bytes sent by SFTP.
  23. /// </summary>
  24. /// <value>Total bytes sent.</value>
  25. public int BytesSent { get; set; }
  26. /// <summary>
  27. /// Gets a user-defined object that qualifies or contains information about an asynchronous operation.
  28. /// </summary>
  29. /// <returns>A user-defined object that qualifies or contains information about an asynchronous operation.</returns>
  30. public object AsyncState { get; internal set; }
  31. /// <summary>
  32. /// Gets a <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.
  33. /// </summary>
  34. /// <returns>
  35. /// A <see cref="WaitHandle"/> that is used to wait for an asynchronous operation to complete.
  36. /// </returns>
  37. public WaitHandle AsyncWaitHandle { get; internal set; }
  38. /// <summary>
  39. /// Gets a value indicating whether the asynchronous operation completed synchronously.
  40. /// </summary>
  41. /// <returns>
  42. /// true if the asynchronous operation completed synchronously; otherwise, false.
  43. /// </returns>
  44. public bool CompletedSynchronously { get; internal set; }
  45. /// <summary>
  46. /// Gets a value indicating whether the asynchronous operation has completed.
  47. /// </summary>
  48. /// <returns>
  49. /// true if the operation is complete; otherwise, false.
  50. /// </returns>
  51. public bool IsCompleted { get; internal set; }
  52. }
  53. }