[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use DO in a Foundation-based daemon
From: |
Richard Frith-Macdonald |
Subject: |
Re: How to use DO in a Foundation-based daemon |
Date: |
Thu, 12 Oct 2006 17:37:10 +0100 |
On 12 Oct 2006, at 17:23, Quentin Mathé wrote:
Hi,
I'm looking for help on how to set up NSConnection properly in a
gnustep daemon (Foundation only).
I tried various strategies without success. I usually start gdomap
from rc.local (running then with nobody identity), I have also
tried to run it with root identity and the flags -fd.
First ... what is the connection for? should it work between
different users on different machines, or is it for a single user on
a single machine.
If the former, you need to use socket ports and need gdomap running
If the latter, you need to use message ports (the default) and do not
need gdomap.
When I call -registerName: on the connection, the method returns
YES as if everything went smoothly but on gdomap side I can clearly
observe that nothing happened.
That's normal ... because gdomap is not needed/used unless you set up
a connection using socket ports.
If you need to use socket ports, to create a connection do
connection = [[NSConnection alloc] initWithReceivePort: [NSSocketPort
port] sendPort: nil];
[connection setRootObject: myserverobject];
[connection registerName: name withNameServer:
[NSSocketPortNameServer sharedInstance]];