A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
Thanks for reaching out!
WinHttpSetTimeouts controls only specific phases (DNS resolve, connect, send, and receive) and does not cover the entire HTTP/HTTPS lifecycle, such as SSL handshake or proxy auto-detection. If asynchronous mode isn't an option, kindly check the alternatives below:
1.Worker Thread+ Manual Timeout: Run the synchronous request in a separate thread and use a timer to call WinHttpCloseHandle( ) if it exceeds your custom timeout. This effectively simulates a global timeout.
2.Status Callback: Register a callback using WinHttpSetStatusCallBack() to log and identify which stage the request hangs on.
3.Disable Auto Proxy Detection (WPAD): Use WINHTTP_ACCESS_TYPE_NO_PROXY or a fixed proxy setting to avoid indefinite waits during proxy discovery.
4.Pre-resolve DNS and Rescue Connections: Avoid repeated DNS or TCP setups where possible to reduce hang risks.
References: WinHttpSetTimeouts function (winhttp.h) - Win32 apps | Microsoft Learn
https://learn.microsoft.com/en-us/windows/win32/api/winhttp/nf-winhttp-winhttpsendrequest
Let me know if you need any further help with this. I will be happy to assist.
If you find this helpful, Kindly mark the provided solution as "Accept Answer", so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.