microsoft / cpprestsdk

The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Other
7.91k stars 1.64k forks source link

WinHttpSendRequest failed after Power Saving Mode #1722

Open decoder71 opened 1 year ago

decoder71 commented 1 year ago

We are using the C++ REST SDK (2.10.18+) very deeply in a multi-threaded Windows-11 client (VS2022/x64/x86). Now a serious problem occurred, that if the PC woke up from Power Saving Mode while the client was running, the http_client can't connect anymore. WinHttpSendRequest() returns error 12002 (ERROR_INTERNET_TIMEOUT). No connection attempt is registered on the server service either. If you start another client instance, everything works fine on the same PC. My guess is that WINHTTP has to be reinitialized in the running application after the PC wakes up from Power Saving Mode.

Has anyone already solved this problem?