diff -r 5936db2c1987 -r 6f539dd9921c TCP/TCPConnection.m --- a/TCP/TCPConnection.m Sun May 25 13:43:03 2008 -0700 +++ b/TCP/TCPConnection.m Thu May 29 16:40:36 2008 -0700 @@ -14,6 +14,15 @@ #import "ExceptionUtils.h" +#if TARGET_OS_IPHONE +// SecureTransport.h is missing on iPhone, with its SSL constants: +enum{ + errSSLClosedAbort = -9806, /* connection closed via error */ +}; +#endif + + + NSString* const TCPErrorDomain = @"TCP"; @@ -62,10 +71,20 @@ { NSInputStream *input = nil; NSOutputStream *output = nil; +#if TARGET_OS_IPHONE + // +getStreamsToHost: is missing for some stupid reason on iPhone. Grrrrrrrrrr. + CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)address.hostname, address.port, + (CFReadStreamRef*)&input, (CFWriteStreamRef*)&output); + if( input ) + [(id)CFMakeCollectable(input) autorelease]; + if( output ) + [(id)CFMakeCollectable(output) autorelease]; +#else [NSStream getStreamsToHost: [NSHost hostWithAddress: address.ipv4name] port: address.port inputStream: &input outputStream: &output]; +#endif return [self _initWithAddress: address inputStream: input outputStream: output]; //FIX: Support localPort! }