You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 6, 2019. It is now read-only.
Hello,
I need to request a redis db containing sets.
I think there is a problem with smembers and its return values :
std::vector<int> el; client.smembers(key), [&] (cpp_redis::reply& reply) { std::vector<cpp_redis::reply> rep = reply.as_array(); for (auto it = rep.begin(); it != rep.end(); it++){ el.push_back(std::stoi(it->as_string())); } }); client.commit();
I get pieces of the good answer and then segfault or memory error if i use this code. But if I put a sleep(1) before (or after) client.commit(); it's ok.
So I think the problem is the client is not reading returned values as far as they're sent. I can't use a sleep(1) because of my application.
Have you ever experienced that ? Thank you for your help.
Hello,
I need to request a redis db containing sets.
I think there is a problem with smembers and its return values :
std::vector<int> el; client.smembers(key), [&] (cpp_redis::reply& reply) { std::vector<cpp_redis::reply> rep = reply.as_array(); for (auto it = rep.begin(); it != rep.end(); it++){ el.push_back(std::stoi(it->as_string())); } }); client.commit();I get pieces of the good answer and then segfault or memory error if i use this code. But if I put a sleep(1) before (or after) client.commit(); it's ok.
So I think the problem is the client is not reading returned values as far as they're sent. I can't use a sleep(1) because of my application.
Have you ever experienced that ? Thank you for your help.