summaryrefslogtreecommitdiffstats
path: root/remote-processor/RemoteProcessorServer.cpp
diff options
context:
space:
mode:
authorKevin Rocard <kevinx.rocard@intel.com>2014-04-23 20:34:14 +0200
committerMattijs Korpershoek <mattijsx.korpershoek@intel.com>2014-06-25 10:52:28 +0200
commitef8d727ca0eb346af951d15d84ba6f2b9564adf5 (patch)
tree533e493aa4814b12c3b49da7ee1ba5864b436042 /remote-processor/RemoteProcessorServer.cpp
parentf976f3749c6639915a646a88049fe523e3d5f051 (diff)
downloadexternal_parameter-framework-ef8d727ca0eb346af951d15d84ba6f2b9564adf5.zip
external_parameter-framework-ef8d727ca0eb346af951d15d84ba6f2b9564adf5.tar.gz
external_parameter-framework-ef8d727ca0eb346af951d15d84ba6f2b9564adf5.tar.bz2
[remote-processor] Add context information on failure
BZ: 190038 Remote processor was not displaying information in case of network read/write error. Add some error messages to ease debug. Change-Id: I465062e8cf77f94b3d4d4d0c71338c4630aac276 Signed-off-by: Kevin Rocard <kevinx.rocard@intel.com> Signed-off-by: Mattijs Korpershoek <mattijsx.korpershoek@intel.com>
Diffstat (limited to 'remote-processor/RemoteProcessorServer.cpp')
-rw-r--r--remote-processor/RemoteProcessorServer.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/remote-processor/RemoteProcessorServer.cpp b/remote-processor/RemoteProcessorServer.cpp
index daa4894..487379e 100644
--- a/remote-processor/RemoteProcessorServer.cpp
+++ b/remote-processor/RemoteProcessorServer.cpp
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright (c) 2011-2014, Intel Corporation
* All rights reserved.
*
@@ -29,6 +29,7 @@
*/
#include "RemoteProcessorServer.h"
#include "ListeningSocket.h"
+#include <iostream>
#include <assert.h>
#include <poll.h>
#include <unistd.h>
@@ -163,10 +164,13 @@ void CRemoteProcessorServer::handleNewConnection()
// Create command message
CRequestMessage requestMessage;
+ string strError;
///// Receive command
- if (!requestMessage.serialize(pClientSocket, false)) {
+ if (!requestMessage.serialize(pClientSocket, false, strError)) {
- // Bail out
+ if (!pClientSocket->hasPeerDisconnected()) {
+ cout << "Error while receiving message: " << strError << endl;
+ }
break;
}
@@ -191,9 +195,10 @@ void CRemoteProcessorServer::handleNewConnection()
CAnswerMessage answerMessage(strResult, bSuccess);
///// Send answer
- if (!answerMessage.serialize(pClientSocket, true)) {
+ if (!answerMessage.serialize(pClientSocket, true, strError)) {
// Bail out
+ cout << "Error while sending message: " << strError << endl;
break;
}
}