NSSocketPort question: retainCount
NSSocketPort question: retainCount
- Subject: NSSocketPort question: retainCount
- From: Fabio Ribeiro <email@hidden>
- Date: Mon, 16 May 2005 08:04:27 -0700
Dear All,
Any idea on why the code below (at least on Tiger - I didn't tested on Panther) reports '2' for the retainCount after I've called only once 'init?'?
After some calls, even calling release, of course I won't be able to open sockets anymore (too many open files for this process) and I'll be with some zoombies running? (one zoombie created per call) I'm not connecting at this time: I'm just creating a NSSocketPort object for test.
- (void)testingSocketPort
{
NSSocketPort *sendPort = nil;
NSLog(@"No object on created: retain count = %d", [sendPort retainCount]);
sendPort = [[NSSocketPort alloc] initRemoteWithTCPPort: @"aServer" host:@"127.0.0.1"];
NSLog(@"init called once: retain count = %d", [sendPort retainCount]);
[sendPort release];
NSLog(@"released called once: retain count = %d", [sendPort retainCount]);
}
Running that on a Timer you'll see that:
RESULTS:
2005-05-16 11:56:38.130 DOCliente[4123] No object on created: retain count = 0
2005-05-16 11:56:38.144 DOCliente[4123] init called once: retain count = 2
2005-05-16 11:56:38.144 DOCliente[4123] released called once: retain count = 1
thanks,
Fabio
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden