瀏覽代碼

update server restart

Luke Pulverenti 7 年之前
父節點
當前提交
6623fe10ee
共有 2 個文件被更改,包括 10 次插入1 次删除
  1. 1 1
      MediaBrowser.Server.Mono/MonoAppHost.cs
  2. 9 0
      SocketHttpListener/Net/EndPointListener.cs

+ 1 - 1
MediaBrowser.Server.Mono/MonoAppHost.cs

@@ -25,7 +25,7 @@ namespace MediaBrowser.Server.Mono
             get
             get
             {
             {
                 // A restart script must be provided
                 // A restart script must be provided
-                return StartupOptions.ContainsOption("-restartpath") && StartupOptions.ContainsOption("-ffmpeg");
+                return StartupOptions.ContainsOption("-restartpath");
             }
             }
         }
         }
 
 

+ 9 - 0
SocketHttpListener/Net/EndPointListener.cs

@@ -93,6 +93,15 @@ namespace SocketHttpListener.Net
                 }
                 }
             }
             }
 
 
+            try
+            {
+                sock.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
+            }
+            catch (SocketException)
+            {
+                // This is not supported on all operating systems (qnap)
+            }
+
             sock.Bind(endpoint);
             sock.Bind(endpoint);
 
 
             // This is the number TcpListener uses.
             // This is the number TcpListener uses.