[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to use DO in a Foundation-based daemon
From: |
Quentin Mathé |
Subject: |
How to use DO in a Foundation-based daemon |
Date: |
Thu, 12 Oct 2006 18:23:43 +0200 |
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.
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. I checked registered names by running
gdomap with -N flag too. The output doesn't include my newly
registered name, but does include the names I register by calling
gdomap -T number -R name.
Here is my setup code :
NSConnection *connect = [NSConnection defaultConnection];
NSRunLoop *runloop = [[NSRunLoop alloc] init];
[connect addRunLoop: runloop];
[connect setRootObject: myServerInstance];
if ([connect registerName: "serverName"] == NO)
NSLog(@"Unable to register the name");
[runloop run];
The problem is the same if I use a custom connection and not the
default one.
May be this problem happens because NSHost default isn't set? On my
machine [NSHost currentHost] returns '((pcubuntu, localhost)
(127.0.0.1, 127.0.1.1))'
If I link AppKit and I call [NSApp run] instead of setting up my own
run loop, -registerName: returns NO failing in a clear manner.
Cheers,
Quentin.
--
Quentin Mathé
qmathe@club-internet.fr
- How to use DO in a Foundation-based daemon,
Quentin Mathé <=