From 1dc81e3d556da4abef195803a6c2742bf40ff8a5 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 30 Dec 2011 12:37:40 +0100 Subject: Added JsonDbClient::setAutoReconnect() Made it optional to automatically reconnect to the server if the connection is lost. Also added explicit connectToServer() and disconnectFromServer() functions. Change-Id: I578c2024f474b515e2dfa009ff4150020bc4378d Sanity-Review: Qt Sanity Bot Reviewed-by: Prasanth Ullattil Reviewed-by: Jamey Hicks --- tools/jsondb-client/client.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/jsondb-client/client.cpp b/tools/jsondb-client/client.cpp index 70197e02..c45616b9 100644 --- a/tools/jsondb-client/client.cpp +++ b/tools/jsondb-client/client.cpp @@ -321,7 +321,8 @@ void Client::usage() { std::stringstream out; out << "Valid commands:" << std::endl - << std::endl + << " connect" << std::endl + << " disconnect" << std::endl << "Direct database commands - these take an explict object" << std::endl << " create [partition:] OBJECT" << std::endl << " update [partition:] OBJECT" << std::endl @@ -490,6 +491,10 @@ bool Client::processCommand(const QString &command) qDebug() << "Sending changesSince: " << stateNumber << "types: " << types; mRequests << mConnection->changesSince(stateNumber, types, partition); + } else if (cmd == "connect") { + mConnection->connectToServer(); + } else if (cmd == "disconnect") { + mConnection->disconnectFromServer(); } else if (!cmd.isEmpty()) { InputThread::print("Unrecognized command: " % cmd); usage(); -- cgit v1.2.3