RequestReceivedEventArgs.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. private readonly HttpRequestMessage _Message;
  12. private readonly IPEndPoint _ReceivedFrom;
  13. public IPAddress LocalIpAddress { get; private set; }
  14. /// <summary>
  15. /// Full constructor.
  16. /// </summary>
  17. public RequestReceivedEventArgs(HttpRequestMessage message, IPEndPoint receivedFrom, IPAddress localIpAddress)
  18. {
  19. _Message = message;
  20. _ReceivedFrom = receivedFrom;
  21. LocalIpAddress = localIpAddress;
  22. }
  23. /// <summary>
  24. /// The <see cref="HttpRequestMessage"/> that was received.
  25. /// </summary>
  26. public HttpRequestMessage Message
  27. {
  28. get { return _Message; }
  29. }
  30. /// <summary>
  31. /// The <see cref="IPEndPoint"/> the request came from.
  32. /// </summary>
  33. public IPEndPoint ReceivedFrom
  34. {
  35. get { return _ReceivedFrom; }
  36. }
  37. }
  38. }