2
0
mirror of https://github.com/boostorg/redis.git synced 2026-02-10 11:42:28 +00:00

Removes redundant examples.

This commit is contained in:
Marcelo Zimbres
2021-01-09 18:56:19 +01:00
parent 9b69a89161
commit cc034e5693
8 changed files with 114 additions and 249 deletions

View File

@@ -26,28 +26,19 @@ int main()
resp::write(socket, req);
std::string buffer;
for (;;) {
switch (req.events.front().first) {
case resp::command::hello:
{
resp::response_flat_map<std::string> res;
resp::read(socket, buffer, res);
print(res.result);
} break;
case resp::command::get:
{
resp::response_blob_string res;
resp::read(socket, buffer, res);
std::cout << "get: " << res.result << std::endl;
} break;
default:
{
resp::response_ignore res;
resp::read(socket, buffer, res);
}
}
req.events.pop();
}
resp::response_flat_map<std::string> hello;
resp::read(socket, buffer, hello);
print(hello.result);
resp::response_simple_string set;
resp::read(socket, buffer, set);
resp::response_blob_string get;
resp::read(socket, buffer, get);
std::cout << "get: " << get.result << std::endl;
resp::response_ignore quit;
resp::read(socket, buffer, quit);
} catch (std::exception const& e) {
std::cerr << e.what() << std::endl;
}