ServerFactory.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. using MediaBrowser.Common;
  2. using MediaBrowser.Common.IO;
  3. using MediaBrowser.Common.Net;
  4. using MediaBrowser.Controller.Configuration;
  5. using MediaBrowser.Controller.Net;
  6. using MediaBrowser.Model.Logging;
  7. using ServiceStack.Logging;
  8. namespace MediaBrowser.Server.Implementations.HttpServer
  9. {
  10. /// <summary>
  11. /// Class ServerFactory
  12. /// </summary>
  13. public static class ServerFactory
  14. {
  15. /// <summary>
  16. /// Creates the server.
  17. /// </summary>
  18. /// <returns>IHttpServer.</returns>
  19. public static IHttpServer CreateServer(IApplicationHost applicationHost,
  20. ILogManager logManager,
  21. IServerConfigurationManager config,
  22. INetworkManager _networkmanager,
  23. IMemoryStreamProvider streamProvider,
  24. string serverName,
  25. string defaultRedirectpath)
  26. {
  27. LogManager.LogFactory = new ServerLogFactory(logManager);
  28. return new HttpListenerHost(applicationHost, logManager, config, serverName, defaultRedirectpath, _networkmanager, streamProvider);
  29. }
  30. }
  31. }