IHttpListener.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using MediaBrowser.Controller.Net;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Threading;
  5. using System.Threading.Tasks;
  6. using MediaBrowser.Model.Services;
  7. namespace Emby.Server.Implementations.HttpServer
  8. {
  9. public interface IHttpListener : IDisposable
  10. {
  11. /// <summary>
  12. /// Gets or sets the error handler.
  13. /// </summary>
  14. /// <value>The error handler.</value>
  15. Action<Exception, IRequest, bool> ErrorHandler { get; set; }
  16. /// <summary>
  17. /// Gets or sets the request handler.
  18. /// </summary>
  19. /// <value>The request handler.</value>
  20. Func<IHttpRequest, Uri, CancellationToken, Task> RequestHandler { get; set; }
  21. /// <summary>
  22. /// Gets or sets the web socket handler.
  23. /// </summary>
  24. /// <value>The web socket handler.</value>
  25. Action<WebSocketConnectEventArgs> WebSocketConnected { get; set; }
  26. /// <summary>
  27. /// Gets or sets the web socket connecting.
  28. /// </summary>
  29. /// <value>The web socket connecting.</value>
  30. Action<WebSocketConnectingEventArgs> WebSocketConnecting { get; set; }
  31. /// <summary>
  32. /// Starts this instance.
  33. /// </summary>
  34. /// <param name="urlPrefixes">The URL prefixes.</param>
  35. void Start(IEnumerable<string> urlPrefixes);
  36. /// <summary>
  37. /// Stops this instance.
  38. /// </summary>
  39. void Stop();
  40. }
  41. }