• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSSocketPort question: retainCount
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSSocketPort question: retainCount
      • From: Douglas Davidson <email@hidden>
    • Re: NSSocketPort question: retainCount
      • From: Nicko van Someren <email@hidden>
  • Prev by Date: Re: embedding web server in cocoa app
  • Next by Date: Re: OpenGL and Tiger
  • Previous by thread: Re: Loading classes for use with NSClassFromString, how?
  • Next by thread: Re: NSSocketPort question: retainCount
  • Index(es):
    • Date
    • Thread