On 10/07/2013 10:00 AM, Frank Ch. Eigler wrote:
Hi, Dave -
I wanted to run this past you all for comments before committing or
pushing anything. It's code that enables PCP server's to announce
themselves over the local network using Avahi, if available.
Great start!
I have only a whitespace nit (a lot of the lines seem unnecessarily
wide) and this observatioN
Understood. I think my editor window comes up with 100 columns where
some probably still stick to the (now) historically irrelevant 80 columns.
@@ -961,6 +965,11 @@ main(int argc, char *argv[])
__pmServerDumpRequestPorts(stderr);
fflush(stderr);
+ /* Advertise our presence on the network. */
+ serverPresence = __pmServerAdvertisePresence(SERVER_SERVICE_NAME,
+ SERVER_SERVICE_TAG,
+ SERVER_PORT);
+
Doing this in pmcd's main() is not ideal. $SERVER_PORT can be easily
overridden by this time. We'd want the actual port numbers used for
ipv4 (and separately, ipv6!) listening announced.
OK. Good catch. re not using using the default port number. Of course it
can be overridden. IPv4 and IPv6 do both listen on the same port,
however. In PMCD, this call can only be made from main, after the port
has been established or at the top of ClientLoop() and I thought that
the latter hid it unnecessarily.
Dave
|