Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 7f3ef04

Browse files
authored
Update ProxyServer.cs
enable socket reuse based on framework via RunTime.IsSocketReuseAvailable
1 parent 20c22dd commit 7f3ef04

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Titanium.Web.Proxy/ProxyServer.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,7 @@ private void listen(ProxyEndPoint endPoint)
654654
{
655655
endPoint.Listener = new TcpListener(endPoint.IpAddress, endPoint.Port);
656656

657-
// linux/macOS has a bug with socket reuse in .net core.
658-
if (ReuseSocket && RunTime.IsWindows)
657+
if (ReuseSocket && RunTime.IsSocketReuseAvailable)
659658
{
660659
endPoint.Listener.Server.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
661660
}

0 commit comments

Comments
 (0)