Re: Rendevouz and Distributed Objects
Re: Rendevouz and Distributed Objects
- Subject: Re: Rendevouz and Distributed Objects
- From: Brant Vasilieff <email@hidden>
- Date: Tue, 15 Apr 2003 23:51:23 -0700
First, you might want to check into the archives for the
rendezvous-request list at lists.apple.com.
There's no need to call [NSConnection
rootProxyForConnectionWithRegisteredName: host:] with Rendezvous.
For one Rendezvous only work across the local network, and it's goal is
to help you automatically find the address and port of published
services, so there's no need to specify the host address. That would
either case the value to be hard coded, or require configuration, which
is what Rendezvous is trying to automate.
Assuming you've found your service and resolved the address, then all
the information you need is stored in the address.
NSData* addressData = [[netService addresses] objectAtIndex:0];
NSSocketPort* sendPort = [[[NSSocketPort alloc]
initRemoteWithProtocolFamily:2 socketType:1 protocol:6
address:addressData] autorelease];
// I hate the above numbers too, but at the time I couldn't find the
matching constants to use. These work,
NSConnection* conn = [[[NSConnection alloc]
initWithReceivePort:(NSPort*)[[sendPort class] port] sendPort:sendPort]
autorelease];
id proxyObj = [conn rootProxy];
[proxyObj setProtocolForProxy:@protocol(YourObjectsProtocol)];
HTH,
Brant
On Tuesday, April 15, 2003, at 09:44 PM,
email@hidden wrote:
Hi,
I am trying to setup my application to discover the server via
rendevouz and then connect via distributed objects. I tried setting up
the connection with NSSocketPort, but it timed out when trying to make
the NSConnection. I then tried using [NSConnection
rootProxyForConnectionWithRegisteredName: host:], but that too failed,
until I changed host to nil, so it would force it to look at the
current machine. This however will not work when the server is on a
separate machine. I am giving host the ip address of where the server
is. In the documentation it says it should be the form of
myhost.mycorp.com, but I could not see anywhere where it says that ip's
are not allowed.
Does anyone know if you can use IP addresses or I have to use a host
name?
Any pointers are greatly appreciated.
Regards,
Greg
_______________________________________________
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.