discuss-gnustep
[Top][All Lists]
Advanced

[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, 19 Oct 2006 07:21:28 +0100


On 19 Oct 2006, at 00:59, Quentin Mathé wrote:

Hi Richard,

Le 12 oct. 06 à 18:37, Richard Frith-Macdonald a écrit :

On 12 Oct 2006, at 17:23, Quentin Mathé wrote:

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.

In my case, it's the latter.

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.

ok.

But I still think there is a host related issue, because my code seems correct if you take in account my daemon is for a single user on a single machine. In my test, it fails in the method -[NSMessagePortNameServer portForName:onHost:]. With NSMessagePort debug level turned on, I get the following ouput :

portForName: /etoilesystem host: pcubuntu
non-local host

Your host name is wrong ...
When you want a connection for the current host you must specify an empty string as the host (or an asterisk ... which means any host). Actually, I think gnustep allows nil as well ... but I wouldn't guarantee that, and would doubt that using nil is portable to MacOS-X

Maybe the message port name server ought to allow any local host name (or even simply ignore the host argument) ... I haven't checked MacOS- X behavior ... the current behavior in GNUstep inherits from the old NeXT behavior where a host name implied the corresponding IP address. Probably we should either ignore the host or generate an error log or raise an exception ... whatever MacOS-X does.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]