pcp
[Top] [All Lists]

Re: First Cut at Avahi Support for PCP Servers

To: "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: First Cut at Avahi Support for PCP Servers
From: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon, 07 Oct 2013 11:27:37 -0400
Cc: PCP <pcp@xxxxxxxxxxx>
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <y0md2nh18r5.fsf@xxxxxxxx>
References: <5251DF3C.7040805@xxxxxxxxxx> <y0md2nh18r5.fsf@xxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7
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

<Prev in Thread] Current Thread [Next in Thread>