robbiehanson/CocoaAsyncSocket — Issue #24: Always Timeout
Author: dhoenig
Created: 2012-02-07 23:24:44+00:00
State: open

Hi,
I guess this is not a bug in the library, but I do not know where else to ask. Please let me know if there is a discussion/help board somewhere. I apologize already for this case.

My problem is that the layer always runs into a timeout when I use it outside the code examples (like ConnectTest).
I have copied/pasted the code from there, and as far as I can tell it's only those few lines that are needed;

dispatch_queue_t mainQueue = dispatch_get_main_queue();

asyncSocket = [[GCDAsyncSocket alloc] initWithDelegate:self delegateQueue:mainQueue];
NSError *error = nil;

if (![asyncSocket connectToHost:RS232_server onPort:RS232_port error:&error])
{
NSLog(@"Unable to connect to due to invalid configuration: %@", error);
}
else
{
NSLog(@"Connecting...");
}

My console says "Connecting", but then I never get the "didConnectToHost" message.

Am I missing something?