I have the following code to execute a PUT to a given address by means of the restc-cpp library:
auto rest_client = RestClient::Create();
auto done = rest_client->ProcessWithPromise([&mess,AI_IP,AI_port,Auth_token](Context& ctx){
auto reply = RequestBuilder(ctx).Put("http://ip_address:port/").Data(message).Execute();
});
try
{
done.get();
}
catch(const exception& ex)
{
...
}
catch(const boost::exception& ex)
{
...
}
RESTC_CPP_IN_COROUTINE_CATCH_ALL
{
...
}
I would like to set a timeout for the execution of this PUT, but I do not find anything for this in the documentation of restc-cpp. Do you know how to do this? Thanks
boost::exceptionto inherit fromstd::exception, and if it does, you will never catch aboost::exceptionif you place that afterstd::exceptionlike you now do. That is, ifexceptionis reallystd::exception. It's impossible to tell from your code snippet.