I am trying to use WinHTTP C ++ / Windows API to connect to multiple Http servers. Before switching to WinHTTP, I tried using HttpClient C # 4.5 in asynchronous mode, however I did not get high bandwidth and the CPU was too high.
In WinHTTP, one request should not take more than 100 ms; however, I noticed that when using WinHTTPSetTimeouts, it does not work even when the timeout is set to 10 ms, but one request to the port on one computer takes 15-30 ms, and when connected to a port that does not listen to any organ, the request is processed 1000 ms, so I came to the conclusion that the timeout does not work.
In addition, I noticed that the time it takes to start a GET request on the same computer takes 15-30 ms, which is too large compared to .NET, which takes 2-7 ms ...
I also tried to set the connection / re-enable / send time to 1 second, but the receive timeout after 4 seconds.
You have a key to how to work with timeouts and why one request takes time.
Shadi source
share