summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2016-02-28 11:40:31 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2016-02-28 11:40:31 -0800
commit3b0983e5464a08e78b5d9fb145858df85af71c3c (patch)
treeff39406649d1b67677b1550cd31df3f57b4ac984
parent89b627719b1546bb9b7b481edf3265f8854420dc (diff)
downloadsdl_ios-3b0983e5464a08e78b5d9fb145858df85af71c3c.tar.gz
Added an error log for invalid TCP IP addresses so developers will understand why their connection is failing.
-rw-r--r--SmartDeviceLink-iOS/SmartDeviceLink/SDLTCPTransport.m3
1 files changed, 3 insertions, 0 deletions
diff --git a/SmartDeviceLink-iOS/SmartDeviceLink/SDLTCPTransport.m b/SmartDeviceLink-iOS/SmartDeviceLink/SDLTCPTransport.m
index b80bf93dd..ff467cc5e 100644
--- a/SmartDeviceLink-iOS/SmartDeviceLink/SDLTCPTransport.m
+++ b/SmartDeviceLink-iOS/SmartDeviceLink/SDLTCPTransport.m
@@ -132,6 +132,9 @@ int call_socket(const char *hostname, const char *port) {
// check if hostname address is valid before we attempt to connect.
SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithAddress(kCFAllocatorDefault, (const struct sockaddr *)hostname);
if (reachability == NULL) {
+ NSString* hostnameString = [NSString stringWithCString:hostname encoding:NSUTF8StringEncoding];
+ NSString* error = [NSString stringWithFormat:@"Invalid IP address of %@. Cancelling connection.", hostnameString];
+ [SDLDebugTool logInfo:error withType:SDLDebugType_Transport_TCP];
return (-1);
} else {
CFRelease(reachability);