RequestReceivedEventArgs.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Net;
  4. using System.Net.Http;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using MediaBrowser.Model.Net;
  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 IpEndPointInfo _ReceivedFrom;
  18. #endregion
  19. public IpAddressInfo LocalIpAddress { get; private set; }
  20. #region Constructors
  21. /// <summary>
  22. /// Full constructor.
  23. /// </summary>
  24. public RequestReceivedEventArgs(HttpRequestMessage message, IpEndPointInfo receivedFrom, IpAddressInfo localIpAddress)
  25. {
  26. _Message = message;
  27. _ReceivedFrom = receivedFrom;
  28. LocalIpAddress = localIpAddress;
  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 IpEndPointInfo ReceivedFrom
  43. {
  44. get { return _ReceivedFrom; }
  45. }
  46. #endregion
  47. }
  48. }