RequestReceivedEventArgs.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Net;
  3. using System.Net.Http;
  4. namespace Rssdp.Infrastructure
  5. {
  6. /// <summary>
  7. /// Provides arguments for the <see cref="ISsdpCommunicationsServer.RequestReceived"/> event.
  8. /// </summary>
  9. public sealed class RequestReceivedEventArgs : EventArgs
  10. {
  11. #region Fields
  12. private readonly HttpRequestMessage _Message;
  13. private readonly IPEndPoint _ReceivedFrom;
  14. #endregion
  15. public IPAddress LocalIpAddress { get; private set; }
  16. #region Constructors
  17. /// <summary>
  18. /// Full constructor.
  19. /// </summary>
  20. public RequestReceivedEventArgs(HttpRequestMessage message, IPEndPoint receivedFrom, IPAddress localIpAddress)
  21. {
  22. _Message = message;
  23. _ReceivedFrom = receivedFrom;
  24. LocalIpAddress = localIpAddress;
  25. }
  26. #endregion
  27. #region Public Properties
  28. /// <summary>
  29. /// The <see cref="HttpRequestMessage"/> that was received.
  30. /// </summary>
  31. public HttpRequestMessage Message
  32. {
  33. get { return _Message; }
  34. }
  35. /// <summary>
  36. /// The <see cref="UdpEndPoint"/> the request came from.
  37. /// </summary>
  38. public IPEndPoint ReceivedFrom
  39. {
  40. get { return _ReceivedFrom; }
  41. }
  42. #endregion
  43. }
  44. }