I\'m converting my socket client to ARC:
- (id)initWithHostname:(NSString *)hostname AndPort:(NSInteger)port
{
if((self = [super init]))
{
oB
I think you should not alloc and init the iStream and oStream variables. They are meant to receive. Without ARC this simply creates two memory leaks that go unnoticed. Now your compiler uses ARC and then it does matter. The receiving variables should be local:
So try:
NSInputStream *iStream;
NSOutputStream *oStream;
oBuffer = [[NSMutableData alloc] init];
iBuffer = [[NSMutableData alloc] init];
[NSStream getStreamsToHost:[NSHost hostWithName:hostname] port:port inputStream:&iStream outputStream:&oStream];
That should work, AFAICT. But note: I can't test this here.