IHttpListener.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Threading;
  3. using System.Threading.Tasks;
  4. using Emby.Server.Implementations.Net;
  5. using MediaBrowser.Model.Services;
  6. using Microsoft.AspNetCore.Http;
  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. Func<Exception, IRequest, bool, bool, Task> ErrorHandler { get; set; }
  16. /// <summary>
  17. /// Gets or sets the request handler.
  18. /// </summary>
  19. /// <value>The request handler.</value>
  20. Func<IHttpRequest, string, string, string, 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. /// Stops this instance.
  28. /// </summary>
  29. Task Stop();
  30. Task ProcessWebSocketRequest(HttpContext ctx);
  31. }
  32. }