BodyEventArgs.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. namespace OSHttpServer.Parser
  3. {
  4. /// <summary>
  5. /// Arguments used when more body bytes have come.
  6. /// </summary>
  7. public class BodyEventArgs : EventArgs
  8. {
  9. /// <summary>
  10. /// Initializes a new instance of the <see cref="BodyEventArgs"/> class.
  11. /// </summary>
  12. /// <param name="buffer">buffer that contains the received bytes.</param>
  13. /// <param name="offset">offset in buffer where to start processing.</param>
  14. /// <param name="count">number of bytes from <paramref name="offset"/> that should be parsed.</param>
  15. public BodyEventArgs(byte[] buffer, int offset, int count)
  16. {
  17. Buffer = buffer;
  18. Offset = offset;
  19. Count = count;
  20. }
  21. /// <summary>
  22. /// Initializes a new instance of the <see cref="BodyEventArgs"/> class.
  23. /// </summary>
  24. public BodyEventArgs()
  25. {
  26. }
  27. /// <summary>
  28. /// Gets or sets buffer that contains the received bytes.
  29. /// </summary>
  30. public byte[] Buffer { get; set; }
  31. /*
  32. /// <summary>
  33. /// Gets or sets number of bytes used by the request.
  34. /// </summary>
  35. public int BytesUsed { get; set; }
  36. */
  37. /// <summary>
  38. /// Gets or sets number of bytes from <see cref="Offset"/> that should be parsed.
  39. /// </summary>
  40. public int Count { get; set; }
  41. /*
  42. /// <summary>
  43. /// Gets or sets whether the body is complete.
  44. /// </summary>
  45. public bool IsBodyComplete { get; set; }
  46. */
  47. /// <summary>
  48. /// Gets or sets offset in buffer where to start processing.
  49. /// </summary>
  50. public int Offset { get; set; }
  51. }
  52. }