CoreAppHost.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections.Generic;
  2. using System.Reflection;
  3. using Emby.Server.Implementations;
  4. using Emby.Server.Implementations.HttpServer;
  5. using Jellyfin.Server.SocketSharp;
  6. using MediaBrowser.Model.IO;
  7. using MediaBrowser.Model.System;
  8. using Microsoft.Extensions.Logging;
  9. namespace Jellyfin.Server
  10. {
  11. public class CoreAppHost : ApplicationHost
  12. {
  13. public CoreAppHost(ServerApplicationPaths applicationPaths, ILoggerFactory loggerFactory, StartupOptions options, IFileSystem fileSystem, IEnvironmentInfo environmentInfo, MediaBrowser.Controller.Drawing.IImageEncoder imageEncoder, MediaBrowser.Common.Net.INetworkManager networkManager)
  14. : base(applicationPaths, loggerFactory, options, fileSystem, environmentInfo, imageEncoder, networkManager)
  15. {
  16. }
  17. public override bool CanSelfRestart => StartupOptions.RestartPath != null;
  18. protected override void RestartInternal() => Program.Restart();
  19. protected override IEnumerable<Assembly> GetAssembliesWithPartsInternal()
  20. {
  21. yield return typeof(CoreAppHost).Assembly;
  22. }
  23. protected override void ShutdownInternal() => Program.Shutdown();
  24. protected override bool SupportsDualModeSockets => true;
  25. protected override IHttpListener CreateHttpListener()
  26. => new WebSocketSharpListener(
  27. Logger,
  28. Certificate,
  29. StreamHelper,
  30. NetworkManager,
  31. SocketFactory,
  32. CryptographyProvider,
  33. SupportsDualModeSockets,
  34. FileSystemManager,
  35. EnvironmentInfo
  36. );
  37. }
  38. }