Dear @StefanOssendorf now DefaultWebClient uses req.Timeout = timeout.Milliseconds; that will trigger the exception that timeout must be greater than 0 or infinite,.
I don't think the current implementation works as expected, for me to work with sync call I needed to create a new WebClient and use TotalMiliseconds.
Originally posted by @ctescu in #4431 (comment)
We are using timeout.Milliseconds here
|
private class DefaultWebClient(TimeSpan timeout, TimeSpan readWriteTimeout) : WebClient |
|
{ |
|
|
|
protected override WebRequest GetWebRequest(Uri address) |
|
{ |
|
var req = base.GetWebRequest(address)!; |
|
if (req is HttpWebRequest httpWebRequest) |
|
{ |
|
if (readWriteTimeout > TimeSpan.Zero) |
|
{ |
|
httpWebRequest.ReadWriteTimeout = readWriteTimeout.Milliseconds; |
|
} |
|
} |
|
if (timeout > TimeSpan.Zero) |
|
{ |
|
req.Timeout = timeout.Milliseconds; |
|
} |
|
return req; |
|
} |
|
} |
instead of
timeout.TotalMilliseconds.
Originally posted by @ctescu in #4431 (comment)
We are using
timeout.Millisecondsherecsla/Source/Csla/DataPortalClient/HttpProxy.cs
Lines 258 to 277 in 60bd0b3
instead of
timeout.TotalMilliseconds.