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

Re: NSSocketPortNameServer problem


  • Subject: Re: NSSocketPortNameServer problem
  • From: Douglas Davidson <email@hidden>
  • Date: Thu, 26 Sep 2002 12:04:49 -0700

On Wednesday, September 25, 2002, at 10:35 PM, Sean Hill wrote:

Is the documentation about Distributed Objects on Jaguar correct?

I can't seem to register my objects using the [NSSocketPortNameServer
sharedInstance] and get DO working across machines.

Does this indeed work? Distributed objects on the local machine works
perfectly.

[[NSConnection defaultConnection] registerName:serverName
withNameServer:[NSSocketPortNameServer sharedInstance]]

This always returns NO for me... doesn't matter what name I try.

The defaultConnection uses a default NSPort, not an NSSocketPort, which means that you cannot register it with the NSSocketPortNameServer. You will need to create your own NSSocketPort, and create your own connection from it, in order to use the NSSocketPortNameServer. Something like this will do the trick:

port = [[NSSocketPort alloc] initWithTCPPort:12345];
connection = [NSConnection connectionWithReceivePort:port sendPort:nil];
[connection setRootObject:@"foo"];
[[NSSocketPortNameServer sharedInstance] registerPort:port name:@"foo"];

Douglas Davidson
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSSocketPortNameServer problem (From: Sean Hill <email@hidden>)

  • Prev by Date: RE: Question about gdb
  • Next by Date: Re: Menu when click on table cell
  • Previous by thread: NSSocketPortNameServer problem
  • Next by thread: NSUndoManager & NSTableView editing
  • Index(es):
    • Date
    • Thread