The Free Software Media System - Server Backend & API
updated nuget
Luke Pulverenti3f1cafdc814c
diff --git a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs b/MediaBrowser.Common.Implementations/BaseApplicationHost.csindex 9c77b8627e..e7a9c00c61 100644--- a/MediaBrowser.Common.Implementations/BaseApplicationHost.cs+++ b/MediaBrowser.Common.Implementations/BaseApplicationHost.cs@@ -215,7 +215,7 @@ namespace MediaBrowser.Common.Implementationstry{// Increase the max http request limit- ServicePointManager.DefaultConnectionLimit = Math.Min(48, ServicePointManager.DefaultConnectionLimit);+ ServicePointManager.DefaultConnectionLimit = Math.Max(48, ServicePointManager.DefaultConnectionLimit);}catch (Exception ex){diff --git a/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs b/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.csindex 251083dc28..8be35071ad 100644--- a/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs+++ b/MediaBrowser.Server.Implementations/WebSocket/AlchemyServer.cs@@ -50,8 +50,6 @@ namespace MediaBrowser.Server.Implementations.WebSocket/// <value>The port.</value>public int Port { get; private set; }- private bool _hasStarted;-/// <summary>/// Starts the specified port number./// </summary>@@ -69,8 +67,6 @@ namespace MediaBrowser.Server.Implementations.WebSocket};WebSocketServer.Start();-- _hasStarted = true;}catch (Exception ex){@@ -141,14 +137,9 @@ namespace MediaBrowser.Server.Implementations.WebSocket{if (WebSocketServer != null){- if (_hasStarted)- {- _logger.Debug("Stopping alchemy server");- WebSocketServer.Stop();- }-+ // Calling dispose will also call stop_logger.Debug("Disposing alchemy server");- WebSocketServer.Dispose();+ WebSocketServer.Stop();WebSocketServer = null;}}diff --git a/MediaBrowser.ServerApplication/MainStartup.cs b/MediaBrowser.ServerApplication/MainStartup.csindex 577f5ea38d..e69d466613 100644--- a/MediaBrowser.ServerApplication/MainStartup.cs+++ b/MediaBrowser.ServerApplication/MainStartup.cs@@ -26,8 +26,6 @@ namespace MediaBrowser.ServerApplicationprivate static ILogger _logger;- private static bool _isRestarting = false;-private static bool _isRunningAsService = false;/// <summary>@@ -132,7 +130,7 @@ namespace MediaBrowser.ServerApplicationif (duplicate != null){_logger.Info("Found a duplicate process. Giving it time to exit.");-+if (!duplicate.WaitForExit(5000)){_logger.Info("The duplicate process did not exit.");@@ -204,7 +202,7 @@ namespace MediaBrowser.ServerApplicationSetErrorMode(ErrorModes.SEM_FAILCRITICALERRORS | ErrorModes.SEM_NOALIGNMENTFAULTEXCEPT |ErrorModes.SEM_NOGPFAULTERRORBOX | ErrorModes.SEM_NOOPENFILEERRORBOX);}-+_app.Run();}@@ -249,13 +247,6 @@ namespace MediaBrowser.ServerApplicationSetErrorMode(ErrorModes.SYSTEM_DEFAULT);}- if (_isRestarting)- {- Process.Start("cmd", "/c net start " + BackgroundService.Name);-- _logger.Info("New service process started");- }-_app.Dispatcher.Invoke(_app.Shutdown);}@@ -270,6 +261,11 @@ namespace MediaBrowser.ServerApplication{ManagedInstallerClass.InstallHelper(new[] { runningPath });+ using (var process = Process.Start("cmd.exe", "/c sc failure " + BackgroundService.Name + " reset= 0 actions= restart/1000/restart/1000/restart/60000"))+ {+ process.WaitForExit();+ }+logger.Info("Service installation succeeded");}catch (Exception ex)@@ -445,15 +441,6 @@ namespace MediaBrowser.ServerApplication_logger.Info("Disposing app host");_appHost.Dispose();- _logger.Info("Starting new instance of server");- RestartInternal();-- _logger.Info("Shutting down existing instance of server.");- Shutdown();- }-- private static void RestartInternal()- {if (!_isRunningAsService){_logger.Info("Starting server application");@@ -461,8 +448,8 @@ namespace MediaBrowser.ServerApplication}else{- _logger.Info("Starting windows service");- RestartWindowsService();+ _logger.Info("Calling Enviornment.Exit to tell Windows to restart the server.");+ Environment.Exit(1);}}@@ -471,11 +458,6 @@ namespace MediaBrowser.ServerApplicationSystem.Windows.Forms.Application.Restart();}- private static void RestartWindowsService()- {- _isRestarting = true;- }-private static void ShutdownWindowsApplication(){_app.Dispatcher.Invoke(_app.Shutdown);diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspecindex 92c8f2c054..b7fd2a38f0 100644--- a/Nuget/MediaBrowser.Common.Internal.nuspec+++ b/Nuget/MediaBrowser.Common.Internal.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common.Internal</id>- <version>3.0.221</version>+ <version>3.0.222</version><title>MediaBrowser.Common.Internal</title><authors>Luke</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.221" />+ <dependency id="MediaBrowser.Common" version="3.0.222" /><dependency id="NLog" version="2.0.1.2" /><dependency id="ServiceStack.Text" version="3.9.58" /><dependency id="SimpleInjector" version="2.3.2" />diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspecindex 3baf5d96fc..f6b3aeef85 100644--- a/Nuget/MediaBrowser.Common.nuspec+++ b/Nuget/MediaBrowser.Common.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"><metadata><id>MediaBrowser.Common</id>- <version>3.0.221</version>+ <version>3.0.222</version><title>MediaBrowser.Common</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspecindex 147850f29e..b8227fa043 100644--- a/Nuget/MediaBrowser.Server.Core.nuspec+++ b/Nuget/MediaBrowser.Server.Core.nuspec@@ -2,7 +2,7 @@<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"><metadata><id>MediaBrowser.Server.Core</id>- <version>3.0.221</version>+ <version>3.0.222</version><title>Media Browser.Server.Core</title><authors>Media Browser Team</authors><owners>ebr,Luke,scottisafool</owners>@@ -12,7 +12,7 @@<description>Contains core components required to build plugins for Media Browser Server.</description><copyright>Copyright © Media Browser 2013</copyright><dependencies>- <dependency id="MediaBrowser.Common" version="3.0.221" />+ <dependency id="MediaBrowser.Common" version="3.0.222" /></dependencies></metadata><files>