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

Update TcpConnectionFactory.cs

enable socket reuse based on framework via RunTime.IsSocketReuseAvailable
parent 3ad8b0d4
...@@ -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