RequestReceivedEventArgs.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Net;
  5. using System.Net.Http;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace Rssdp.Infrastructure
  9. {
  10. /// <summary>
  11. /// Provides arguments for the <see cref="ISsdpCommunicationsServer.RequestReceived"/> event.
  12. /// </summary>
  13. public sealed class RequestReceivedEventArgs : EventArgs
  14. {
  15. #region Fields
  16. private readonly HttpRequestMessage _Message;
  17. private readonly UdpEndPoint _ReceivedFrom;
  18. #endregion
  19. #region Constructors
  20. /// <summary>
  21. /// Full constructor.
  22. /// </summary>
  23. /// <param name="message">The <see cref="HttpRequestMessage"/> that was received.</param>
  24. /// <param name="receivedFrom">A <see cref="UdpEndPoint"/> representing the sender's address (sometimes used for replies).</param>
  25. public RequestReceivedEventArgs(HttpRequestMessage message, UdpEndPoint receivedFrom)
  26. {
  27. _Message = message;
  28. _ReceivedFrom = receivedFrom;
  29. }
  30. #endregion
  31. #region Public Properties
  32. /// <summary>
  33. /// The <see cref="HttpRequestMessage"/> that was received.
  34. /// </summary>
  35. public HttpRequestMessage Message
  36. {
  37. get { return _Message; }
  38. }
  39. /// <summary>
  40. /// The <see cref="UdpEndPoint"/> the request came from.
  41. /// </summary>
  42. public UdpEndPoint ReceivedFrom
  43. {
  44. get { return _ReceivedFrom; }
  45. }
  46. #endregion
  47. }
  48. }