2013-03-07 00:34:00 -05:00
|
|
|
|
using MediaBrowser.Common;
|
2013-12-07 10:52:38 -05:00
|
|
|
|
using MediaBrowser.Controller.Net;
|
2013-02-24 16:53:54 -05:00
|
|
|
|
using MediaBrowser.Model.Logging;
|
2013-12-08 21:24:48 -05:00
|
|
|
|
using ServiceStack.Logging;
|
2013-02-24 16:53:54 -05:00
|
|
|
|
|
2013-03-07 00:34:00 -05:00
|
|
|
|
namespace MediaBrowser.Server.Implementations.HttpServer
|
2013-02-24 16:53:54 -05:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Class ServerFactory
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static class ServerFactory
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Creates the server.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="applicationHost">The application host.</param>
|
2013-04-17 15:16:36 -04:00
|
|
|
|
/// <param name="logManager">The log manager.</param>
|
2013-02-24 16:53:54 -05:00
|
|
|
|
/// <param name="serverName">Name of the server.</param>
|
|
|
|
|
|
/// <param name="defaultRedirectpath">The default redirectpath.</param>
|
|
|
|
|
|
/// <returns>IHttpServer.</returns>
|
2014-10-06 19:58:46 -04:00
|
|
|
|
public static IHttpServer CreateServer(IApplicationHost applicationHost,
|
|
|
|
|
|
ILogManager logManager,
|
|
|
|
|
|
string serverName,
|
2015-01-18 14:53:34 -05:00
|
|
|
|
string defaultRedirectpath)
|
2013-02-24 16:53:54 -05:00
|
|
|
|
{
|
2013-12-08 21:24:48 -05:00
|
|
|
|
LogManager.LogFactory = new ServerLogFactory(logManager);
|
2014-10-06 19:58:46 -04:00
|
|
|
|
|
2015-01-18 14:53:34 -05:00
|
|
|
|
return new HttpListenerHost(applicationHost, logManager, serverName, defaultRedirectpath);
|
2013-02-24 16:53:54 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|