Commit Graph

6 Commits

Author SHA1 Message Date
nathan 9cf2f08852
avahi: Fix exception when #:timeout is #f.
* guix/avahi.scm (avahi-publish-service-thread): Fixes crash when timeout is
  #f, which is the default for "guix publish --advertise"

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-07-11 15:47:56 +02:00
Ludovic Courtès 0ae419877c
avahi: Poll less.
* guix/avahi.scm (avahi-publish-service-thread): Have #:timeout default
to #f when 'stop-loop?' is NEVER, or 500ms.
(avahi-browse-service-thread): #:timeout defaults to 500ms when
'stop-loop?' is provided.
2023-07-07 15:30:21 +02:00
Ludovic Courtès 248cf06149
avahi: Resolve hosts for which name resolution fails.
This avoids attempts to connect to hosts that went off-line.  This is
particularly important for 'guix-daemon --discover', which would so far
keep attempting to talk to LAN hosts after they vanished just because
their mDNS record hasn't expired, leading to significant delays when
fetching narinfos and substitutes.

* guix/avahi.scm (avahi-browse-service-thread)[service-resolver-callback]:
Add handler to RESOLVER-EVENT/FAILURE.
2023-06-16 00:14:52 +02:00
Ludovic Courtès f9978346e7
avahi: Remove poll timeout when possible.
Fixes <https://issues.guix.gnu.org/45314>.

* guix/avahi.scm (avahi-browse-service-thread): Change timeout default value
to false when no "stop-loop?" procedure is passed. Adapt "iterate-simple-poll"
call accordingly.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
2020-12-20 10:40:57 +01:00
Mathieu Othacehe 0faef87178
avahi: Ignore local services.
* guix/avahi.scm (avahi-browse-service-thread): Add "ignore-local?" argument
and honor it.
2020-12-10 09:48:03 +01:00
Mathieu Othacehe 375cc7dea2
Add Avahi support.
* guix/avahi.scm: New file.
* Makefile.am (MODULES): Add it.
* configure.ac: Add Guile-Avahi dependency.
* doc/guix.texi (Requirements): Document it.
* gnu/packages/package-management.scm (guix)[native-inputs]: Add
"guile-avahi",
[propagated-inputs]: ditto.
* guix/self.scm (specification->package): Add guile-avahi.
(compiled-guix): Ditto.
2020-11-29 15:08:26 +01:00