WebAPI DefaultTimeout is not set to a reasonable default
The default timeout for WebAPI requests is set to a fixed 100 seconds currently, and there's no simple way to reconfigure it for classes like SteamDirectory that use the SteamConfigurationWebAPIExtensions to generate WebAPI interfaces from the SteamConfiguration.
https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Steam/WebAPI/WebAPI.cs https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Steam/WebAPI/SteamConfigurationWebAPIExtensions.cs
There should probably be:
- A reasonable default closer to ConnectionTimeout (understanding that for HTTP requests, this is a full round trip timeout)
- The option to configure the timeout
- Why do we need to reconfigure it?
- What is a "reasonable" timeout?
- Are you trying to lower or raise the timeout? ConnectionTimeout seems to be much lower.
- Would something like making
WebAPI.DefaultTimeoutsettable resolve the problem (if perhaps not ideal) or do you want different timeouts for different interfaces?
- If the user can configure all the other timeouts, including ConnectionTimeout and CDNClient timeouts, they should also be able to configure the timeouts that affect all WebAPI based requests.
- A reasonable timeout is probably closer to 30 seconds for a full request and response.
- I want to lower the timeout used to fetch the server list in SteamDirectory, as ConnectionTimeout is set to 5 seconds while the lookup is set to 100 seconds, as this affects how long CMClient.Connect takes (105 seconds in this case)
- Being able to set WebAPI.DefaultTimeout would be sufficient.
Also to be clear, if you own a WebAPI instance, there is a configurable Timeout property. https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Steam/WebAPI/WebAPI.cs#L47
In this case, SteamDirectory owns the WebAPI instance https://github.com/SteamRE/SteamKit/blob/master/SteamKit2/SteamKit2/Steam/WebAPI/SteamDirectory.cs#L50
SteamDirectory owns it, and has a SteamConfiguration instance, so I'm tempted to add SteamConfiguration.WebApiTimeout so that it's not just some big static that people have to mutate.
Any thoughts on that?
SteamConfiguration.WebApiTimeout sounds good because you can get instances of WebAPI from Configuration.