Upgrade TCPConnector messages from DEBUG to ERROR / INFO.

This makes the client a lot more "chatty" but also a lot more informative
as to what's actually going on connection-wise.
This commit is contained in:
Peter Johnson
2015-11-30 01:14:37 -08:00
parent ac9e42af36
commit 7182b9a6b5

View File

@@ -100,7 +100,7 @@ std::unique_ptr<NetworkStream> TCPConnector::connect(const char* server,
if (timeout == 0) {
int sd = socket(AF_INET, SOCK_STREAM, 0);
if (::connect(sd, (struct sockaddr*)&address, sizeof(address)) != 0) {
DEBUG("connect() to " << server << " port " << port << " failed: " << SocketStrerror());
ERROR("connect() to " << server << " port " << port << " failed: " << SocketStrerror());
return nullptr;
}
return std::unique_ptr<NetworkStream>(new TCPStream(sd, &address));
@@ -139,15 +139,15 @@ std::unique_ptr<NetworkStream> TCPConnector::connect(const char* server,
len = sizeof(int);
getsockopt(sd, SOL_SOCKET, SO_ERROR, (char*)(&valopt), &len);
if (valopt) {
DEBUG("select() to " << server << " port " << port << " error " << valopt << " - " << SocketStrerror(valopt));
ERROR("select() to " << server << " port " << port << " error " << valopt << " - " << SocketStrerror(valopt));
}
// connection established
else
result = 0;
} else
DEBUG("connect() timed out");
INFO("connect() to " << server << " port " << port << " timed out");
} else
DEBUG("connect() to " << server << " port " << port << " error " << SocketErrno() << " - " << SocketStrerror());
ERROR("connect() to " << server << " port " << port << " error " << SocketErrno() << " - " << SocketStrerror());
}
// Return socket to blocking mode