CoreAppHost.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. using System.Collections.Generic;
  2. using System.Reflection;
  3. using Emby.Server.Implementations;
  4. using Emby.Server.Implementations.HttpServer;
  5. using Jellyfin.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, ISystemEvents systemEvents, MediaBrowser.Common.Net.INetworkManager networkManager)
  14. : base(applicationPaths, loggerFactory, options, fileSystem, environmentInfo, imageEncoder, systemEvents, networkManager)
  15. {
  16. }
  17. public override bool CanSelfRestart => StartupOptions.ContainsOption("-restartpath");
  18. protected override void RestartInternal() => Program.Restart();
  19. protected override IEnumerable<Assembly> GetAssembliesWithPartsInternal()
  20. => new[] { typeof(CoreAppHost).Assembly };
  21. protected override void ShutdownInternal() => Program.Shutdown();
  22. protected override bool SupportsDualModeSockets => true;
  23. protected override IHttpListener CreateHttpListener()
  24. => new WebSocketSharpListener(
  25. Logger,
  26. Certificate,
  27. StreamHelper,
  28. TextEncoding,
  29. NetworkManager,
  30. SocketFactory,
  31. CryptographyProvider,
  32. SupportsDualModeSockets,
  33. FileSystemManager,
  34. EnvironmentInfo
  35. );
  36. }
  37. }