ServerFactory.cs 1.1 KB

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