aboutsummaryrefslogtreecommitdiff
path: root/SocketHttpListener
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-10-13 01:47:50 -0400
committerGitHub <noreply@github.com>2017-10-13 01:47:50 -0400
commit7619ff7db543df3d8228aa87aa82a544e8dda54f (patch)
tree79aba09ffadbaefc52986b45eeaae78d1b883771 /SocketHttpListener
parent526dea4f6fad60626aa4eb6b8560a4f00ec52351 (diff)
parent2f06bb5bf52dc4dfc3d1763488d215a7e352a1fc (diff)
Merge pull request #2951 from MediaBrowser/dev
Dev
Diffstat (limited to 'SocketHttpListener')
-rw-r--r--SocketHttpListener/Net/EndPointListener.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/SocketHttpListener/Net/EndPointListener.cs b/SocketHttpListener/Net/EndPointListener.cs
index 2b1479e42..48c0ae7cb 100644
--- a/SocketHttpListener/Net/EndPointListener.cs
+++ b/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);
// This is the number TcpListener uses.