From 2b1542d7fee7e9ef14592e88c8a974ed4ea2eacf Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 30 Jul 2015 17:53:46 +0200 Subject: Tested command loop with Ping command. Ping is a command that by definition doesn't affect the resource, and thus can be used at all times to check if the resource is still alive. --- common/commands.cpp | 2 ++ common/commands.h | 1 + common/listener.cpp | 3 +++ 3 files changed, 6 insertions(+) (limited to 'common') diff --git a/common/commands.cpp b/common/commands.cpp index 99313b9..221c211 100644 --- a/common/commands.cpp +++ b/common/commands.cpp @@ -55,6 +55,8 @@ QByteArray name(int commandId) return "Shutdown"; case NotificationCommand: return "Notification"; + case PingCommand: + return "Ping"; case CustomCommand: return "Custom"; }; diff --git a/common/commands.h b/common/commands.h index 1baedcc..da2438a 100644 --- a/common/commands.h +++ b/common/commands.h @@ -45,6 +45,7 @@ enum CommandIds { SearchSourceCommand, // need a buffer definition for this, but relies on Query API ShutdownCommand, NotificationCommand, + PingCommand, CustomCommand = 0xffff }; diff --git a/common/listener.cpp b/common/listener.cpp index 96d87be..8532ade 100644 --- a/common/listener.cpp +++ b/common/listener.cpp @@ -246,6 +246,9 @@ void Listener::processCommand(int commandId, uint messageId, const QByteArray &c m_server->close(); QTimer::singleShot(0, this, &Listener::quit); break; + case Akonadi2::Commands::PingCommand: + Log() << QString("\tReceived ping command from %1").arg(client.name); + break; default: if (commandId > Akonadi2::Commands::CustomCommand) { Log() << QString("\tReceived custom command from %1: ").arg(client.name) << commandId; -- cgit v1.2.3