diff --git a/examples/redis/01_client/client.hpp b/examples/redis/01_client/client.hpp index 69641f0..0aba388 100644 --- a/examples/redis/01_client/client.hpp +++ b/examples/redis/01_client/client.hpp @@ -13,11 +13,10 @@ class RedisClient : public QObject MR::Request* m_request; public: - RedisClient() + RedisClient(QObject* parent = nullptr) : QObject(parent) { connect(&m_client, &MR::Client::connected, this, &RedisClient::slotConnected); m_client.connectToHost("127.0.0.1"); - } virtual ~RedisClient() {} @@ -33,6 +32,9 @@ public: qDebug() << const_cast(reply).value().toString(); m_request->disconnect(); m_request->deleteLater(); + + m_request = m_client.sendCommand( "SET value 10" ); + connect(m_request, &MR::Request::reply, this, &RedisClient::slotSetValue); } @@ -62,6 +64,6 @@ public: Q_SLOT void slotSubscribeTest( const MR::Reply& reply) { qDebug() << static_cast(reply.type()); - qDebug() << const_cast(reply).value().toByteArray(); + qDebug() << const_cast(reply).value(); } };