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

NSConnection questions


  • Subject: NSConnection questions
  • From: Douglas Norton <email@hidden>
  • Date: Tue, 20 Nov 2001 10:08:55 +0000

Dear All,

Background: I am writing something similar to a chat app, that needs to find
similar processes running on different Macs on the same subnet. I need a
wildcard search to find one other similar process, I do not have any
previous knowledge about the other clients on the network.

1. Am I right in thinking that this [below] does not work, as the @"*"
wildcard lookup is broken for searches over a subnet due to name server
complications?

id theProxy = [[NSConnection
rootProxyForConnectionWithRegisteredName:@"servedObject"
host:@"*"] retain];

2. My code to serve an object is:

NSConnection* theConnection = [NSConnection defaultConnection];

if ( theConnection )
{
[theConnection setRootObject: self];

if ( [theConnection registerName:@"servedObject"] == NO )
NSLog( @"Could not register servedObject.\n" );
else
// do the useful stuff here
}
else
NSLog( @"No [NSConnection defaultConnection].\n" );

How can I discover if this has worked, as I do not get the log messages,
i.e. Should this show up in the Network Utility port scan if I enter my own
IP address?

3. If I go down the route of using the example code posted by Chris Kane in
"DO over TCP sockets example for Mac OS X", how can I do the equivalent of a
wildcard search? Chris Kane's example takes the hostname as an argument to
the app when it is launched. I do not have this option, I have to find a
host programmatically.

Regards

Douglas J. Norton


  • Follow-Ups:
    • Re: NSConnection questions
      • From: Eric Peyton <email@hidden>
  • Prev by Date: Re: Drawer in Drawer
  • Next by Date: What's up with sinf()?
  • Previous by thread: Re: Mixing Cocoa/Java problem
  • Next by thread: Re: NSConnection questions
  • Index(es):
    • Date
    • Thread