Re: problem with DO
Re: problem with DO
- Subject: Re: problem with DO
- From: Greg Hulands <email@hidden>
- Date: Tue, 22 Apr 2003 17:19:30 +1000
I think you would need to create an instance of NSConnection, not just
use the default connection.
eg
<code snippet>
//setup DO connection
NSSocketPort *sport = [[NSSocketPort alloc] initWithTCPPort:port];
if (![[NSSocketPortNameServer sharedInstance] registerPort:sport
name:serverName])
NSLog(@"Error registering with NSSocketPortNameServer");
connection = [[NSConnection alloc] initWithReceivePort:sport
sendPort:nil];
[connection setRootObject:self];
</code snippet>
HTH,
Greg
On Tuesday, April 22, 2003, at 04:03 PM, Lloyd Dupont wrote:
>
this code sample (below) doesn't work (I mean registerName: return NO)
>
what could be wrong ?
>
does NSSocketPortNameServer require specific initialization ?
>
>
id serverObject = [[Server new] autorelease];
>
NSConnection * theConnection = [NSConnection defaultConnection];
>
[theConnection setRootObject: serverObject];
>
if([theConnection registerName:@"mon serveur a moi"
>
withNameServer:[NSSocketPortNameServer
>
sharedInstance]] == NO) {
>
_______________________________________________
>
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.
_______________________________________________
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.