From f8263b8b69bac872f5b821e32f52fb502665976b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Tue, 7 May 2013 15:07:51 -0400 Subject: improve restart code after port change --- MediaBrowser.ServerApplication/ApplicationHost.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'MediaBrowser.ServerApplication/ApplicationHost.cs') diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 309a2c351..37e6d1b8d 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -431,6 +431,27 @@ namespace MediaBrowser.ServerApplication } } + /// + /// Called when [configuration updated]. + /// + /// The sender. + /// The instance containing the event data. + protected override void OnConfigurationUpdated(object sender, EventArgs e) + { + base.OnConfigurationUpdated(sender, e); + + if (!string.Equals(HttpServer.UrlPrefix, ServerKernel.HttpServerUrlPrefix, StringComparison.OrdinalIgnoreCase)) + { + NotifyPendingRestart(); + } + + else if (!ServerManager.SupportsNativeWebSocket && ServerManager.WebSocketPortNumber != ServerConfigurationManager.Configuration.LegacyWebSocketPortNumber) + { + NotifyPendingRestart(); + } + + } + /// /// Restarts this instance. /// -- cgit v1.2.3