diff options
Diffstat (limited to 'remote-processor/RemoteProcessorServer.cpp')
-rw-r--r-- | remote-processor/RemoteProcessorServer.cpp | 13 |
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; } } |