IHttpListener.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma warning disable CS1591
  2. using System;
  3. using System.Threading;
  4. using System.Threading.Tasks;
  5. using Emby.Server.Implementations.Net;
  6. using MediaBrowser.Model.Services;
  7. using Microsoft.AspNetCore.Http;
  8. namespace Emby.Server.Implementations.HttpServer
  9. {
  10. public interface IHttpListener : IDisposable
  11. {
  12. /// <summary>
  13. /// Gets or sets the error handler.
  14. /// </summary>
  15. /// <value>The error handler.</value>
  16. Func<Exception, IRequest, bool, bool, Task> ErrorHandler { get; set; }
  17. /// <summary>
  18. /// Gets or sets the request handler.
  19. /// </summary>
  20. /// <value>The request handler.</value>
  21. Func<IHttpRequest, string, string, string, CancellationToken, Task> RequestHandler { get; set; }
  22. /// <summary>
  23. /// Gets or sets the web socket handler.
  24. /// </summary>
  25. /// <value>The web socket handler.</value>
  26. Action<WebSocketConnectEventArgs> WebSocketConnected { get; set; }
  27. /// <summary>
  28. /// Stops this instance.
  29. /// </summary>
  30. Task Stop();
  31. Task ProcessWebSocketRequest(HttpContext ctx);
  32. }
  33. }