Skip to content

Commit 03fc685

Browse files
HttpClient timeout was not working well in .NET Framework
1 parent f4ffed2 commit 03fc685

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dotnet/src/dotnetframework/GxClasses/Domain/GxHttpClient.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,11 @@ HttpResponseMessage ExecuteRequest(string method, string requestUrl, CookieConta
652652
if (proxy != null)
653653
handler.Proxy = proxy;
654654
HttpResponseMessage response;
655+
656+
#if !NETCORE
657+
handler.ReceiveDataTimeout = TimeSpan.FromMilliseconds(_timeout);
658+
handler.ReceiveHeadersTimeout = TimeSpan.FromMilliseconds(_timeout);
659+
#endif
655660
using (client = new HttpClient(handler))
656661
{
657662
client.Timeout = TimeSpan.FromMilliseconds(_timeout);

0 commit comments

Comments
 (0)