diff options
author | Frédéric Boisnard <fredericx.boisnard@intel.com> | 2014-01-10 18:46:33 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:04:17 +0100 |
commit | 6c55e9a1829f613f37df4e5fd0dbdde006a76707 (patch) | |
tree | c4f25a3e0b6241c13c5c9202895a3a77c42b47e1 /remote-processor | |
parent | 9e3882819ce9d1fcc99a3ea3efa549e87efa7e7a (diff) | |
download | external_parameter-framework-6c55e9a1829f613f37df4e5fd0dbdde006a76707.zip external_parameter-framework-6c55e9a1829f613f37df4e5fd0dbdde006a76707.tar.gz external_parameter-framework-6c55e9a1829f613f37df4e5fd0dbdde006a76707.tar.bz2 |
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>
Diffstat (limited to 'remote-processor')
-rw-r--r-- | remote-processor/ConnectionSocket.cpp | 5 | ||||
-rw-r--r-- | remote-processor/ListeningSocket.cpp | 9 |
2 files changed, 11 insertions, 3 deletions
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 @@ bool CConnectionSocket::connect(const string& strRemote, uint16_t uiPort, string // 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 @@ bool CListeningSocket::listen(uint16_t uiPort) // 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; } |