• 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
NSSocketPortNameServer issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSSocketPortNameServer issue


  • Subject: NSSocketPortNameServer issue
  • From: Ben Lachman <email@hidden>
  • Date: Wed, 29 Dec 2004 17:36:48 -0500

I'm having some trouble removing my ports from the NSSocketPortNameServer.

Basically I set up my server this way:

localNameServer = [[NSSocketPortNameServer sharedInstance] retain];

serverPort = [[NSSocketPort alloc] initWithTCPPort:0];
serverConnection = [[NSConnection connectionWithReceivePort:serverPort sendPort:serverPort] retain];


[serverConnection setRootObject:self];


serviceName = [[NSString stringWithString:@"TextServer"] retain];

if( [localNameServer portForName:serviceName host:@"*" nameServerPortNumber:nil] == nil ) {
[localNameServer registerPort:serverPort name:serviceName];
}

And then I assume I should be able to remove it this way:

if( [localNameServer removePortForName:serviceName] == NO ) {
NSLog(@"Unable to remove port");
} else {
NSLog(@"Port removed successfully");
}

[serverPort invalidate];
[serverConnection invalidate];

But every time I run it, I am not able to restart the server with the same name. In fact, I've added some code in and I can still query the nameserver for the port and it will happily give it to me.

Anyone have any idea how I can actually make it remove the port.

TIA,
->Ben


––––––––––––––––––––––––––––––––––––––––
Ben Lachman • email@hidden
email@hidden • 740.594.9192

Apple Campus Representative
Ohio University

 _______________________________________________
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

  • Prev by Date: Re: NSLog and printf not working!!!1
  • Next by Date: ScreenSaverView with multiple displays
  • Previous by thread: NSSound-related crash on quit
  • Next by thread: ScreenSaverView with multiple displays
  • Index(es):
    • Date
    • Thread