Hi,
Based on feedback received by email I have reworked the code. The work
has been pushed to the brolley/dev branch of pcpfans. As of now, these
are the relevant, unmerged commits, although the entire branch should be
merge-able.
Dave
-----------------------------------------------------
commit 97b1d9e75832624b0d1250b9d23513125fbdbf90
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon Oct 28 12:46:24 2013 -0400
Configuration enhancements for dns-sd from nathans.
Also a few tweaks to make it merge cleanly with the current
code.
commit c554195887ace7d3c5007be893ffe8d0c539db92
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon Oct 28 11:10:44 2013 -0400
Rework libpcp support for servers to announce their presence on the
network.
- Plug the leak of avahi-ness in the API:
- abstracted __pmServerPresence to be an opaque struct which
can contain information about multiple broadcast methods.
Currently only avahi is represented. The server need not be
aware of which one(s) are available/active.
- Replaced __pmServerSetServiceName() and __pmServerSetServiceTag()
with __pmServerSetServiceSpec(const char *). The argument is
a string which identifies the service to be advertised. Currently,
it is simply the name of the server (e.g. "pmcd").
- __pmServerAdvertisePresence() can now use multiple methods
(currently only avahi) to advertise the server. Similarly,
__pmServerUnadvertisePresence() can clean up all of the
active announcements.
commit 2c2bb7e60f8229076ac1ca5b43435d412e55168e
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date: Mon Oct 21 10:38:28 2013 -0400
Reformat code to eliminate long source lines.
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()
This code is accessed via the new API functions
__pmServerAdvertisePresence() and __pmServerUnadvertisePresence()
|