NSConnection Problem
NSConnection Problem
- Subject: NSConnection Problem
- From: "Michael P. Rogers" <email@hidden>
- Date: Fri, 12 Oct 2001 09:04:25 -0500
What goes in the host field when I'm trying to get a proxy to a
remote object, using rootProxyForConnectionWithRegisteredName:host:?
I tried using the DNS name of my remote computer, but that doesn't
seem to work (in the sense that messages don't seem to be getting to
my remote object -- nothing's showing up in the console).
Do I have to register the NSConnection object first, somehow?
For the record, here's what I'm doing in my server's awakeFromNib method:
NSConnection * theConnection;
woofie = [[Dog alloc]init];
theConnection = [NSConnection defaultConnection];
[theConnection setRootObject:woofie];
if([theConnection registerName:@"MyFavoriteServer"] == NO)
NSLog(@"Something bad happened in awakeFromNib");
and here's what I'm doing in the client's action (when I click on a button):
id theProxy;
theProxy = [[NSConnection
rootProxyForConnectionWithRegisteredName:@"MyFavoriteServer"
host:@"math.millikin.edu"] retain];
[theProxy setProtocolForProxy:@protocol(AnimalProtocol)];
[theProxy bark];
Thanks for any assistance,
Michael
--
Dr. Michael P. Rogers
Office: 203G Shilling Hall
Phone: 217-424-6327 (W) 309-828-8655 (H) 309-825-6454 (C)
E-Mail: email@hidden
Web site:
http://math.millikin.edu/
Astronomy Site:
http://twincityamateurastronomers.org