Hi ByoungInKim,
I'm not aware of any issues multi-threaded issues. Here are a couple of things I did notice in the code you have posted.
I'm not aware of any issues multi-threaded issues. Here are a couple of things I did notice in the code you have posted.
-
The error codes you are printing out are incorrect. You can't call GetLastError() to retrieve it, there many have been several OS or other function calls since the one calling the error. We store the underlying error code and message inside the http_exception class. Take a look at the http_exception::error_code() API, it returns a std::error_code.
-
Please note the read_to_end API is asynchronous, also if an exception occurs during the read you will end up with an unobserved exception. My recommendation would be to use a try/catch with a task based continuation like you've done for the http_client::request asynchronous call.