Re: Rendezvous & StartupItems
Re: Rendezvous & StartupItems
- Subject: Re: Rendezvous & StartupItems
- From: Ryan McGann <email@hidden>
- Date: Mon, 16 Jun 2003 20:10:38 -0700
my service require also DO, and although it does work , we never know !
which service should I require for NSNameServer and NSSocketNameServer
to be already initialized ?
NSNameServer and NSSocketNameServer use the Mach bootstrap server,
which should be initialized very early in the system startup. You can't
explicitly "require" it in your StartupItems AFAIK.
Note that your StartupItem can be a distributed objects server, but not
client. That is, applications can connect to your daemon using
distributed objects, but your daemon cannot connect to your application
using distributed objects. This is a security precaution in Mac OS
X....processes started up before any user has logged in cannot "see"
mach ports created by processes started after a user has logged in.
Just thought I'd warn you since this tripped us up big time.
I think (without being sure) that the error happen when:
when I start the program I check locally for a connection named "name
of my program". I think that, when I restart it sometimes find a
"phantom" connection to its former self and bug like that when trying
to connect to it... any though ?
Your assumption is correct. This is a bug in Mac OS X IMHO. What you
can do is use the process ID of your startup item as part of the name
when you register your DO server with NSConnection. For example, we do
this:
[connection registerName:[NSString
stringWithFormat:@"myDistributedObjectServer.%d", getpid()]]
which solves the problem, but then all your processes must know the pid
of the server before they can connect to it. Solving that problem is
much trickier.
Ryan
There are three kinds of people in the world: Those that can count, and
those that can't.
_______________________________________________
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.