I am running into an issue. Same code running OK on iPhone (iOS 5) and iPhone/iPad simulator. But it does not work on an iPad (iOS 5). I'd appreciate any help.
Here is read port code:
//Code for read port.
CFIndex bytesRead = CFReadStreamRead(inputStream, bufferPoint, 1024);
if (bytesRead < 0) {
NSLog(@"bytesRead < 0");
CFErrorRef error = CFReadStreamCopyError(inputStream);
//reportError(error);
DEBUGLOG(@"readResponse error \n")
Before above, there is connection part code.
//prevent to release before relocate
if ((inputStream != nil) && (outputStream != nil)) {
[inputStream release];
inputStream = nil;
[outputStream release];
outputStream = nil;
}
[NSStream getStreamsToHostNamed:relayHost port:relayPort inputStream:&inputStream outputStream:&outputStream];
//[self lgetStreamsToHostNamed:relayHost port:relayPort inputStream:&inputStream outputStream:&outputStream];
if ((inputStream != nil) && (outputStream != nil))
{
sendState = kIMAPConnecting;
isSecure = NO;
[inputStream retain];
[outputStream retain];
[inputStream setDelegate:self];
[outputStream setDelegate:self];
result = [inputStream setProperty:NSStreamSocketSecurityLevelNegotiatedSSL forKey:NSStreamSocketSecurityLevelKey];
DEBUGLOG(@"inputStream setProperty result: %d", result);
result =[ outputStream setProperty:NSStreamSocketSecurityLevelNegotiatedSSL forKey:NSStreamSocketSecurityLevelKey];
DEBUGLOG(@"outputStream setProperty result: %d", result);
if (!CFReadStreamOpen(inputStream)) {
DEBUGLOG(@"inputStream open failed");
return NO;
}
if (!CFWriteStreamOpen(outputStream)) {
DEBUGLOG(@"outputStream open failed");
return NO;
}
self.inputString = [NSMutableString string];
DEBUGLOG(@"SCRIMAPMessage startToConnect end with YES\n");
return YES;
}