Improve verbosity during PFW socket creation

BZ: 151780

Debugging XML generation from .pfw files is uneasy because the
log messages are lacking ports & sockets information.

Added the port number to the logs of the PFW when a new socket
is created.

Change-Id: I688f954068a6819ecc9e65f7664ac7a98ca0dabf
Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp
index 88270c5..999cb1f 100644
--- a/parameter/ParameterMgr.cpp
+++ b/parameter/ParameterMgr.cpp
@@ -79,6 +79,7 @@
 #include "XmlMemoryDocSink.h"
 #include "XmlMemoryDocSource.h"
 #include "Utility.h"
+#include <sstream>
 
 #define base CElement
 
@@ -2235,7 +2236,10 @@
         // Start
         if (!_pRemoteProcessorServer->start()) {
 
-            strError = "Unable to start remote processor server";
+            ostringstream oss;
+            oss << "ParameterMgr: Unable to start remote processor server on port "
+                << getConstFrameworkConfiguration()->getServerPort();
+            strError = oss.str();
 
             return false;
         }
diff --git a/remote-processor/ConnectionSocket.cpp b/remote-processor/ConnectionSocket.cpp
index 58ca070..3b14798 100644
--- a/remote-processor/ConnectionSocket.cpp
+++ b/remote-processor/ConnectionSocket.cpp
@@ -28,6 +28,7 @@
 #include <netinet/in.h>
 #include <stdio.h>
 #include <errno.h>
+#include <sstream>
 
 #define base CSocket
 
@@ -57,7 +58,9 @@
     // Connect
     if (::connect(getFd(), (struct sockaddr *)&server_addr, sizeof(struct sockaddr))) {
 
-        perror("CConnectionSocket::connect::connect");
+        ostringstream oss;
+        oss << "CConnectionSocket::connect::connect on port: " << uiPort;
+        perror(oss.str().c_str());
 
         strError = "Unable to connnect to target :-(";
 
diff --git a/remote-processor/ListeningSocket.cpp b/remote-processor/ListeningSocket.cpp
index 02819e2..620aed1 100644
--- a/remote-processor/ListeningSocket.cpp
+++ b/remote-processor/ListeningSocket.cpp
@@ -30,6 +30,7 @@
 #include <assert.h>
 #include <netdb.h>
 #include <strings.h>
+#include <sstream>
 
 #include <stdio.h>
 #include <errno.h>
@@ -54,14 +55,18 @@
     // Bind
     if (bind(getFd(), (struct sockaddr*)&server_addr, sizeof(struct sockaddr)) == -1) {
 
-        perror("CListeningSocket::listen::bind");
+        ostringstream oss;
+        oss << "CListeningSocket::listen::bind port " << uiPort;
+        perror(oss.str().c_str());
 
         return false;
     }
 
     if (::listen(getFd(), 5) == -1) {
 
-        perror("CListeningSocket::listen::bind");
+        ostringstream oss;
+        oss << "CListeningSocket::listen::bind port " << uiPort;
+        perror(oss.str().c_str());
 
         return false;
     }