diff options
| author | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-02 13:51:53 -0400 |
|---|---|---|
| committer | Mark Monteiro <marknr.monteiro@protonmail.com> | 2020-04-02 13:51:53 -0400 |
| commit | eadad7311777c68cf7daa55e267b296573466b8a (patch) | |
| tree | 6cd384a16198f24401fcf0cb0edef39e44175311 /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | |
| parent | 123bfbcf19a06bc45f13ff0c25b1f34a5d9f94b8 (diff) | |
| parent | 5a816f0b22cec12d193b19fcb9f21c7d085a3fbf (diff) | |
Merge branch 'master' into use-development-exception-page
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpListenerHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index e8ea8d033..62735b7cf 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -64,6 +64,7 @@ namespace Emby.Server.Implementations.HttpServer IXmlSerializer xmlSerializer, IHttpListener socketListener, ILocalizationManager localizationManager, + ServiceController serviceController, IHostEnvironment hostEnvironment) { _appHost = applicationHost; @@ -75,6 +76,8 @@ namespace Emby.Server.Implementations.HttpServer _jsonSerializer = jsonSerializer; _xmlSerializer = xmlSerializer; _socketListener = socketListener; + ServiceController = serviceController; + _socketListener.WebSocketConnected = OnWebSocketConnected; _hostEnvironment = hostEnvironment; @@ -95,7 +98,7 @@ namespace Emby.Server.Implementations.HttpServer public string GlobalResponse { get; set; } - public ServiceController ServiceController { get; private set; } + public ServiceController ServiceController { get; } public object CreateInstance(Type type) { @@ -602,17 +605,15 @@ namespace Emby.Server.Implementations.HttpServer /// <summary> /// Adds the rest handlers. /// </summary> - /// <param name="services">The services.</param> - /// <param name="listeners"></param> - /// <param name="urlPrefixes"></param> - public void Init(IEnumerable<IService> services, IEnumerable<IWebSocketListener> listeners, IEnumerable<string> urlPrefixes) + /// <param name="serviceTypes">The service types to register with the <see cref="ServiceController"/>.</param> + /// <param name="listeners">The web socket listeners.</param> + /// <param name="urlPrefixes">The URL prefixes. See <see cref="UrlPrefixes"/>.</param> + public void Init(IEnumerable<Type> serviceTypes, IEnumerable<IWebSocketListener> listeners, IEnumerable<string> urlPrefixes) { _webSocketListeners = listeners.ToArray(); UrlPrefixes = urlPrefixes.ToArray(); - ServiceController = new ServiceController(); - var types = services.Select(r => r.GetType()); - ServiceController.Init(this, types); + ServiceController.Init(this, serviceTypes); ResponseFilters = new Action<IRequest, HttpResponse, object>[] { |
