Unverified Commit 20c22ddc authored by Allen Byron Penner's avatar Allen Byron Penner Committed by GitHub

Update TcpConnectionFactory.cs

enable socket based on framework version via RunTime.IsSocketReuseAvailable
parent c007cb68
...@@ -315,8 +315,7 @@ namespace Titanium.Web.Proxy.Network.Tcp ...@@ -315,8 +315,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
tcpClient.SendTimeout = proxyServer.ConnectionTimeOutSeconds * 1000; tcpClient.SendTimeout = proxyServer.ConnectionTimeOutSeconds * 1000;
tcpClient.LingerState = new LingerOption(true, proxyServer.TcpTimeWaitSeconds); tcpClient.LingerState = new LingerOption(true, proxyServer.TcpTimeWaitSeconds);
// linux has a bug with socket reuse in .net core. if (proxyServer.ReuseSocket && RunTime.IsSocketReuseAvailable)
if (proxyServer.ReuseSocket && RunTime.IsWindows)
{ {
tcpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true); tcpClient.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment