Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
575d14ac
Commit
575d14ac
authored
Aug 09, 2018
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disable socket reuse in linux/macOS
parent
81feeb2b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
TcpConnectionFactory.cs
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
+1
-1
ProxyServer.cs
Titanium.Web.Proxy/ProxyServer.cs
+3
-3
No files found.
Titanium.Web.Proxy/Network/Tcp/TcpConnectionFactory.cs
View file @
575d14ac
...
@@ -277,7 +277,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
...
@@ -277,7 +277,7 @@ namespace Titanium.Web.Proxy.Network.Tcp
};
};
//linux has a bug with socket reuse in .net core.
//linux has a bug with socket reuse in .net core.
if
(
proxyServer
.
ReuseSocket
&&
!
RunTime
.
IsLinux
)
if
(
proxyServer
.
ReuseSocket
&&
RunTime
.
IsWindows
||
RunTime
.
IsRunningOnMono
)
{
{
tcpClient
.
Client
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReuseAddress
,
true
);
tcpClient
.
Client
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReuseAddress
,
true
);
}
}
...
...
Titanium.Web.Proxy/ProxyServer.cs
View file @
575d14ac
...
@@ -193,7 +193,7 @@ namespace Titanium.Web.Proxy
...
@@ -193,7 +193,7 @@ namespace Titanium.Web.Proxy
/// <summary>
/// <summary>
/// Should we reuse client/server tcp sockets.
/// Should we reuse client/server tcp sockets.
/// Default is true (
false for linux
due to bug in .Net core).
/// Default is true (
disabled for linux/macOS
due to bug in .Net core).
/// </summary>
/// </summary>
public
bool
ReuseSocket
{
get
;
set
;
}
=
true
;
public
bool
ReuseSocket
{
get
;
set
;
}
=
true
;
...
@@ -617,8 +617,8 @@ namespace Titanium.Web.Proxy
...
@@ -617,8 +617,8 @@ namespace Titanium.Web.Proxy
{
{
endPoint
.
Listener
=
new
TcpListener
(
endPoint
.
IpAddress
,
endPoint
.
Port
);
endPoint
.
Listener
=
new
TcpListener
(
endPoint
.
IpAddress
,
endPoint
.
Port
);
//linux has a bug with socket reuse in .net core.
//linux
/macOS
has a bug with socket reuse in .net core.
if
(
ReuseSocket
&&
!
RunTime
.
IsLinux
)
if
(
ReuseSocket
&&
(
RunTime
.
IsWindows
||
RunTime
.
IsRunningOnMono
)
)
{
{
endPoint
.
Listener
.
Server
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReuseAddress
,
true
);
endPoint
.
Listener
.
Server
.
SetSocketOption
(
SocketOptionLevel
.
Socket
,
SocketOptionName
.
ReuseAddress
,
true
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment