I'm using CocoaAsyncTask and trying to connect to the localhost. When I run it from the simulator, it works (I'm checking it with the provided echo server) but when I run it on the actual device, nothing happens.. the code is:
if(![socket connectToHost:@"localhost" onPort:8080 error:nil]) {
NSLog(@"Error..");
}
-(void)socket:(GCDAsyncSocket *)socket didConnectToHost:(NSString *)host: port:(uint16_t)port {
NSLog(@"Connected");
}
Any ideas? Thanks!