RequestReceivedEventArgs.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. using MediaBrowser.Model.Net;
  9. namespace Rssdp.Infrastructure
  10. {
  11. /// <summary>
  12. /// Provides arguments for the <see cref="ISsdpCommunicationsServer.RequestReceived"/> event.
  13. /// </summary>
  14. public sealed class RequestReceivedEventArgs : EventArgs
  15. {
  16. #region Fields
  17. private readonly HttpRequestMessage _Message;
  18. private readonly IpEndPointInfo _ReceivedFrom;
  19. #endregion
  20. public IpAddressInfo LocalIpAddress { get; private set; }
  21. #region Constructors
  22. /// <summary>
  23. /// Full constructor.
  24. /// </summary>
  25. public RequestReceivedEventArgs(HttpRequestMessage message, IpEndPointInfo receivedFrom, IpAddressInfo localIpAddress)
  26. {
  27. _Message = message;
  28. _ReceivedFrom = receivedFrom;
  29. LocalIpAddress = localIpAddress;
  30. }
  31. #endregion
  32. #region Public Properties
  33. /// <summary>
  34. /// The <see cref="HttpRequestMessage"/> that was received.
  35. /// </summary>
  36. public HttpRequestMessage Message
  37. {
  38. get { return _Message; }
  39. }
  40. /// <summary>
  41. /// The <see cref="UdpEndPoint"/> the request came from.
  42. /// </summary>
  43. public IpEndPointInfo ReceivedFrom
  44. {
  45. get { return _ReceivedFrom; }
  46. }
  47. #endregion
  48. }
  49. }