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
124443c5
Commit
124443c5
authored
Apr 08, 2019
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
36f8342f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
ProxyServer.cs
src/Titanium.Web.Proxy/ProxyServer.cs
+11
-6
No files found.
src/Titanium.Web.Proxy/ProxyServer.cs
View file @
124443c5
...
@@ -732,13 +732,19 @@ namespace Titanium.Web.Proxy
...
@@ -732,13 +732,19 @@ namespace Titanium.Web.Proxy
if
(
tcpClient
!=
null
)
if
(
tcpClient
!=
null
)
{
{
S
etThreadPoolMinThread
(
1
);
// increase the ThreadPool
s
etThreadPoolMinThread
(
1
);
// increase the ThreadPool
Task
.
Run
(
async
()
=>
Task
.
Run
(
async
()
=>
{
try
{
{
await
handleClient
(
tcpClient
,
endPoint
);
await
handleClient
(
tcpClient
,
endPoint
);
}
finally
{
setThreadPoolMinThread
(-
1
);
//decrease the Threadpool
}
SetThreadPoolMinThread
(-
1
);
//decrease the Threadpool
});
});
}
}
...
@@ -750,7 +756,7 @@ namespace Titanium.Web.Proxy
...
@@ -750,7 +756,7 @@ namespace Titanium.Web.Proxy
/// Change the ThreadPool.WorkerThread minThread
/// Change the ThreadPool.WorkerThread minThread
/// </summary>
/// </summary>
/// <param name="piNbWorkerThreadsToAdd">Number of threads to add</param>
/// <param name="piNbWorkerThreadsToAdd">Number of threads to add</param>
void
S
etThreadPoolMinThread
(
int
piNbWorkerThreadsToAdd
)
private
void
s
etThreadPoolMinThread
(
int
piNbWorkerThreadsToAdd
)
{
{
if
(
EnableThreadPoolOptimizing
)
if
(
EnableThreadPoolOptimizing
)
{
{
...
@@ -774,8 +780,7 @@ namespace Titanium.Web.Proxy
...
@@ -774,8 +780,7 @@ namespace Titanium.Web.Proxy
{
{
tcpClient
.
ReceiveTimeout
=
ConnectionTimeOutSeconds
*
1000
;
tcpClient
.
ReceiveTimeout
=
ConnectionTimeOutSeconds
*
1000
;
tcpClient
.
SendTimeout
=
ConnectionTimeOutSeconds
*
1000
;
tcpClient
.
SendTimeout
=
ConnectionTimeOutSeconds
*
1000
;
tcpClient
.
SendBufferSize
=
BufferSize
;
tcpClient
.
ReceiveBufferSize
=
BufferSize
;
tcpClient
.
LingerState
=
new
LingerOption
(
true
,
TcpTimeWaitSeconds
);
tcpClient
.
LingerState
=
new
LingerOption
(
true
,
TcpTimeWaitSeconds
);
await
InvokeConnectionCreateEvent
(
tcpClient
,
true
);
await
InvokeConnectionCreateEvent
(
tcpClient
,
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