Fix 100% Cpu Bug · Code-Sharp/uHttpSharp@bd0f1e3 · GitHub
Skip to content

Commit bd0f1e3

Browse files
committed
Fix 100% Cpu Bug
1 parent 1992406 commit bd0f1e3

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎uhttpsharp.dll.nuspec‎

Lines changed: 1 addition & 1 deletion

‎uhttpsharp/Clients/TcpClientAdapter.cs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,15 @@ public TcpClientAdapter(TcpClient client)
1414
_client = client;
1515
_stream = _client.GetStream();
1616

17-
// The next lines are commented out because they caused exceptions, And i'm not sure why it has been added in the first place.
17+
// The next lines are commented out because they caused exceptions,
18+
// They have been added because .net doesn't allow me to wait for data (ReadAsyncBlock).
19+
// Instead, I've added Task.Delay in MyStreamReader.ReadBuffer when
20+
// Read returns without data.
21+
1822
// See https://github.com/Code-Sharp/uHttpSharp/issues/14
1923

2024
// Read Timeout of one second.
2125
// _stream.ReadTimeout = 1000;
22-
2326
}
2427

2528
public Stream Stream

‎uhttpsharp/RequestProviders/IStreamReader.cs‎

Lines changed: 7 additions & 0 deletions

0 commit comments

Comments
 (0)