IHttpListener.cs 1.2 KB

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