[launchd-dev] SampleD failure with dynamic SockServiceName

Dave Zarzycki zarzycki at apple.com
Fri Jun 6 09:01:36 PDT 2008


David,

What version of the OS are you on?

davez

On Jun 5, 2008, at 1:12 PM, David Anderson wrote:

> My intention is have launchd start a daemon on a dynamic port, publish
> the port number via bonjour, and then connect to this port after
> determining the port number using CFNetService (Bonjour).
>
> Starting from SampleD (and using the included client.pl), I can
> advertise the service on a hard-coded port via bonjour, lookup the
> port number using Bonjour Browser, modify client.pl to use this port,
> and connect using client.pl.  The SampleD binary starts correctly in
> an OnDemand fashion correctly.
>
> If I change
> <key>SockServiceName</key>
> <string>12345</string>
>
> to
> <key>SockServiceName</key>
> <string>0</string>
>
> then lookup the dynamic port number using Bonjour Browser and
> configure client.pl to use this port, client.pl will NOT connect to
> this port and outputs this error:
>
> connect: Connection refused at ./client.pl line 77.
>
> With a dynamic port, I am unable to connect to this port using a
> modified client.pl.  I can find no evidence that the SampleD binary is
> starting in an OnDemand fashion.
>
> Adding
> <key>OnDemand</key>
> <false/>
> has no effect.
>
> Is there anything different about the default configuration of a
> dynamic port vs a hard-coded port that would impeded the ability to
> connect to the dynamically assigned port?
>
>
> Thanks,
> Dave
> _______________________________________________
> launchd-dev mailing list
> launchd-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev



More information about the launchd-dev mailing list