Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Ensaan

macrumors newbie
Original poster
Feb 7, 2012
1
0
Hi All
Hope You Doing Well,
when i am executing this code the len(int) coming < 0.
please let me know the reason please?




NSString *urlStr = [[NSString alloc] initWithString:mad:"website.com"];
NSURL *website = [NSURL URLWithString:urlStr ];



CFReadStreamRef readStream;
CFWriteStreamRef writeStream;
CFStreamCreatePairWithSocketToHost(NULL, (CFStringRef)[website host], 4444, &readStream, &writeStream);
iStream = (NSInputStream *)readStream;
oStream = (NSOutputStream *)writeStream;


[iStream open];
[oStream open];

uint8_t buffer[1024];
int len = [iStream read:buffer maxLength:sizeof(buffer)];
}
// len is coming <0 at the time of excution..??
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.