summaryrefslogtreecommitdiff
path: root/guix/avahi.scm
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2023-07-14 07:46:15 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2023-07-14 07:46:15 +0200
commitd67507cacf934b970f67567bced4e044c3ca9753 (patch)
treeb1c3160946ceaf74a9a24c7360d28036230210e1 /guix/avahi.scm
parent3b3d9a13dd2bd67f34c890047680a1ce6e3af28e (diff)
parentdd4c1992103a65b8fbdc80fe07a9fe9be822769a (diff)
Merge branch 'master' into gnome-team
Diffstat (limited to 'guix/avahi.scm')
-rw-r--r--guix/avahi.scm20
1 files changed, 12 insertions, 8 deletions
diff --git a/guix/avahi.scm b/guix/avahi.scm
index cb0c85f9f4..574fe0b850 100644
--- a/guix/avahi.scm
+++ b/guix/avahi.scm
@@ -49,11 +49,17 @@
(port avahi-service-port)
(txt avahi-service-txt))
+(define never
+ ;; Never true.
+ (const #f))
+
(define* (avahi-publish-service-thread name
#:key
type port
- (stop-loop? (const #f))
- (timeout 100)
+ (stop-loop? never)
+ (timeout (if (eq? stop-loop? never)
+ #f
+ 500))
(txt '()))
"Publish the service TYPE using Avahi, for the given PORT, on all interfaces
and for all protocols. Also, advertise the given TXT record list.
@@ -78,7 +84,9 @@ when STOP-LOOP? procedure returns true."
client-flag/ignore-user-config)
client-callback)))
(while (not (stop-loop?))
- (iterate-simple-poll poll timeout))))))
+ (if timeout
+ (iterate-simple-poll poll timeout)
+ (iterate-simple-poll poll)))))))
(define (interface->ip-address interface)
"Return the local IP address of the given INTERFACE."
@@ -89,10 +97,6 @@ when STOP-LOOP? procedure returns true."
(close-port socket)
ip))
-(define never
- ;; Never true.
- (const #f))
-
(define* (avahi-browse-service-thread proc
#:key
types
@@ -101,7 +105,7 @@ when STOP-LOOP? procedure returns true."
(stop-loop? never)
(timeout (if (eq? stop-loop? never)
#f
- 100)))
+ 500)))
"Browse services which type is part of the TYPES list, using Avahi. The
search is restricted to services with the given FAMILY. Each time a service
is found or removed, PROC is called and passed as argument the corresponding