summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-12-14 10:17:42 -0500
committerJoel Fischer <joeljfischer@gmail.com>2017-12-14 10:17:42 -0500
commit5dd8644b8d022b0c4d33f7182253954e026b700c (patch)
tree1ca99cccce7a626cf7cf2daeba4649133e2cb6e0
parent7ed4cd7d1a8dac432e98df6f1eb76ea82111f947 (diff)
downloadsdl_ios-5dd8644b8d022b0c4d33f7182253954e026b700c.tar.gz
Revert "Merge pull request #818 from Toyota-BSalahat/hotfix/tcpBackgroundConnection"
This reverts commit 7ed4cd7d1a8dac432e98df6f1eb76ea82111f947, reversing changes made to dbe8e637d736eab90bcc0b18bf80b36a6797e618.
-rw-r--r--SmartDeviceLink/SDLTCPTransport.m30
1 files changed, 14 insertions, 16 deletions
diff --git a/SmartDeviceLink/SDLTCPTransport.m b/SmartDeviceLink/SDLTCPTransport.m
index 298ea70c7..91e693c8b 100644
--- a/SmartDeviceLink/SDLTCPTransport.m
+++ b/SmartDeviceLink/SDLTCPTransport.m
@@ -46,22 +46,20 @@ static void TCPCallback(CFSocketRef socket, CFSocketCallBackType type, CFDataRef
}
- (void)connect {
- [[NSOperationQueue mainQueue] addOperationWithBlock:^{
- SDLLogD(@"Attemping to connect");
-
- int sock_fd = call_socket([self.hostName UTF8String], [self.portNumber UTF8String]);
- if (sock_fd < 0) {
- SDLLogE(@"Server not ready, connection failed");
- return;
- }
-
- CFSocketContext socketCtxt = {0, (__bridge void *)(self), NULL, NULL, NULL};
- socket = CFSocketCreateWithNative(kCFAllocatorDefault, sock_fd, kCFSocketDataCallBack | kCFSocketConnectCallBack, (CFSocketCallBack)&TCPCallback, &socketCtxt);
- CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0);
- CFRunLoopRef loop = CFRunLoopGetCurrent();
- CFRunLoopAddSource(loop, source, kCFRunLoopDefaultMode);
- CFRelease(source);
- }];
+ SDLLogD(@"Attemping to connect");
+
+ int sock_fd = call_socket([self.hostName UTF8String], [self.portNumber UTF8String]);
+ if (sock_fd < 0) {
+ SDLLogE(@"Server not ready, connection failed");
+ return;
+ }
+
+ CFSocketContext socketCtxt = {0, (__bridge void *)(self), NULL, NULL, NULL};
+ socket = CFSocketCreateWithNative(kCFAllocatorDefault, sock_fd, kCFSocketDataCallBack | kCFSocketConnectCallBack, (CFSocketCallBack)&TCPCallback, &socketCtxt);
+ CFRunLoopSourceRef source = CFSocketCreateRunLoopSource(kCFAllocatorDefault, socket, 0);
+ CFRunLoopRef loop = CFRunLoopGetCurrent();
+ CFRunLoopAddSource(loop, source, kCFRunLoopDefaultMode);
+ CFRelease(source);
}
- (void)sendData:(NSData *)msgBytes {