Re: Using DO from daemon
Re: Using DO from daemon
- Subject: Re: Using DO from daemon
- From: Neil Rhodes <email@hidden>
- Date: Thu, 22 May 2003 21:20:51 -0700
Yes, the server is up. The client doesn't actually try to contact the
server until a particular user action occurs. As a matter of fact, the
server is guaranteed to be running, because the client launches it!
Neil
On Thursday, May 22, 2003, at 03:27 PM, email@hidden wrote:
This may seem obvious, but is the server up prior to the client being
executed?
On Thu, 22 May 2003 15:17:01 -0700, Neil Rhodes wrote:
I've got an command-line app that acts as a client to a distributed
objects server. The app can't get the root proxy if it's running as a
startup item, but can when run from the command-line.
The server vends its proxy with:
[self createConnectionName: @"foo"];
- (NSConnection*) createConnectionName:(NSString*)name
{
NSConnection* newConnection=[[NSConnection alloc] init];
if ([newConnection registerName:name])
{
[newConnection setRootObject:self];
}
else
{
[newConnection release];
newConnection=nil;
}
return newConnection;
}
The client obtains its proxy with:
id rootProxy = [NSConnection
rootProxyForConnectionWithRegisteredName:@"foo" host: nil];
The server is a normal Cocoa application running with user
permissions.
The client is a command-line background application running as root.
If the client is launched from the command-line with:
sudo client &
it works fine (obtains the proxy and is able to successfully use it).
If the client is run from a StartupItem (/Library/StartupItems script)
with:
client &
then rootProxy is nil.
In fact, as a check, I've also tried:
NSConnection *c = [NSConnection
connectionWithRegisteredName:@"foo"
host: nil];
It too returns nil.
This may be related to a posting from October, 2001
<http://www.omnigroup.com/mailman/archive/macosx-dev/2001-October/
019728.html> where someone was having a similar problem running an
application from crontab (worked fine from the command line, failed
when running from crontab). However, there were no replies to the
question at that time.
Thanks,
Neil
--
Neil Rhodes
Calliope Enterprises, Inc.
1328 Clock Avenue
Redlands, CA 92374
(909) 793-5995
email@hidden
_______________________________________________
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.
Zameer M. Andani
email@hidden
604.275.6664
http://zameer.is.dreaming.org
"There are 10 types of people in the world.
Those that can read binary and those that can't."
--
Neil Rhodes
Calliope Enterprises, Inc.
1328 Clock Avenue
Redlands, CA 92374
(909) 793-5995
email@hidden
_______________________________________________
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.