IHttpListener.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Net;
  3. using System.Security.Principal;
  4. namespace WebDAVSharp.Server.Adapters
  5. {
  6. /// <summary>
  7. /// This is an interface-version of the parts of
  8. /// <see cref="HttpListener" /> that
  9. /// the
  10. /// <see cref="WebDavServer" /> requires to operator.
  11. /// </summary>
  12. /// <remarks>
  13. /// The main purpose of this interface is to facilitate unit-testing.
  14. /// </remarks>
  15. public interface IHttpListener : IAdapter<HttpListener>, IDisposable
  16. {
  17. /// <summary>
  18. /// Gets the Uniform Resource Identifier (
  19. /// <see cref="Uri" />) prefixes handled by the
  20. /// adapted
  21. /// <see cref="HttpListener" /> object.
  22. /// </summary>
  23. /// <value>
  24. /// The prefixes.
  25. /// </value>
  26. HttpListenerPrefixCollection Prefixes { get; }
  27. /// <summary>
  28. /// Allows the adapted <see cref="HttpListener" /> to receive incoming requests.
  29. /// </summary>
  30. void Start();
  31. /// <summary>
  32. /// Causes the adapted <see cref="HttpListener" /> to stop receiving incoming requests.
  33. /// </summary>
  34. void Stop();
  35. /// <summary>
  36. /// Returns the windows Idenity to use for the request.
  37. /// </summary>
  38. /// <param name="context"></param>
  39. /// <returns></returns>
  40. IIdentity GetIdentity(IHttpListenerContext context);
  41. }
  42. }