ChannelWindowAdjustMessage.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. namespace Renci.SshNet.Messages.Connection
  2. {
  3. /// <summary>
  4. /// Represents SSH_MSG_CHANNEL_SUCCESS message.
  5. /// </summary>
  6. [Message("SSH_MSG_CHANNEL_WINDOW_ADJUST", 93)]
  7. public class ChannelWindowAdjustMessage : ChannelMessage
  8. {
  9. /// <summary>
  10. /// Gets number of bytes to add to the window.
  11. /// </summary>
  12. public uint BytesToAdd { get; private set; }
  13. /// <summary>
  14. /// Initializes a new instance of the <see cref="ChannelWindowAdjustMessage"/> class.
  15. /// </summary>
  16. public ChannelWindowAdjustMessage()
  17. {
  18. }
  19. /// <summary>
  20. /// Initializes a new instance of the <see cref="ChannelWindowAdjustMessage"/> class.
  21. /// </summary>
  22. /// <param name="localChannelNumber">The local channel number.</param>
  23. /// <param name="bytesToAdd">The bytes to add.</param>
  24. public ChannelWindowAdjustMessage(uint localChannelNumber, uint bytesToAdd)
  25. {
  26. LocalChannelNumber = localChannelNumber;
  27. BytesToAdd = bytesToAdd;
  28. }
  29. /// <summary>
  30. /// Called when type specific data need to be loaded.
  31. /// </summary>
  32. protected override void LoadData()
  33. {
  34. base.LoadData();
  35. BytesToAdd = ReadUInt32();
  36. }
  37. /// <summary>
  38. /// Called when type specific data need to be saved.
  39. /// </summary>
  40. protected override void SaveData()
  41. {
  42. base.SaveData();
  43. Write(BytesToAdd);
  44. }
  45. }
  46. }