pcp
[Top] [All Lists]

Re: [pcp] First Cut at Avahi Support for PCP Servers

To: PCP <pcp@xxxxxxxxxxx>
Subject: Re: [pcp] First Cut at Avahi Support for PCP Servers
From: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon, 07 Oct 2013 16:49:20 -0400
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <5251DF3C.7040805@xxxxxxxxxx>
References: <5251DF3C.7040805@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7
Based on Frank's feedback, I have pushed this commit to the brolley/dev branch on pcpfans. The updated code supports auto-advertising of all request ports during __pmServerOpenRequestPorts() and auto-unadvertising during __pmServerCloseRequestPorts().

With pmcd, there is currently a small issue in that it opens its log after calling __pmServerOpenRequestPorts(), so the informational log messages indicating that the service is being advertised end up on stderr. Is there any reason not to open the log first?

Dave
---------------------------
commit 5cdeaa18b367a16d80a1a6066116d74749281929
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date:   Mon Oct 7 16:21:55 2013 -0400

    libpcp support for servers to advertise on the local network.

    - Support is provided by Avahi, where available and otherwise disabled.
    - Servers indicate that they want to advertise their presence by
      calling __pmServerSetServiceName() and/or __pmServerSetServiceTag().
      When one or both of these functions has been called before
      __pmServerOpenRequestPorts(), then __pmServerOpenRequestPorts() will
advertise the server once for each port it is listening on. The service
      for each port will be unadvertised when __pmCloseRequestPorts() is
      called or when the server shuts down.
    - Servers may also advertise themselves directly by calling
      __pmServerAdvertisePresence()/__pmServerUnadvertisePresence()

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