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>master
parent
e03552d5d4
commit
f9978346e7
|
@ -89,13 +89,19 @@ when STOP-LOOP? procedure returns true."
|
||||||
(close-port socket)
|
(close-port socket)
|
||||||
ip))
|
ip))
|
||||||
|
|
||||||
|
(define never
|
||||||
|
;; Never true.
|
||||||
|
(const #f))
|
||||||
|
|
||||||
(define* (avahi-browse-service-thread proc
|
(define* (avahi-browse-service-thread proc
|
||||||
#:key
|
#:key
|
||||||
types
|
types
|
||||||
(ignore-local? #t)
|
(ignore-local? #t)
|
||||||
(family AF_INET)
|
(family AF_INET)
|
||||||
(stop-loop? (const #f))
|
(stop-loop? never)
|
||||||
(timeout 100))
|
(timeout (if (eq? stop-loop? never)
|
||||||
|
#f
|
||||||
|
100)))
|
||||||
"Browse services which type is part of the TYPES list, using Avahi. The
|
"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
|
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
|
is found or removed, PROC is called and passed as argument the corresponding
|
||||||
|
@ -167,4 +173,6 @@ when STOP-LOOP? procedure returns true."
|
||||||
client-callback)))
|
client-callback)))
|
||||||
(and (client? client)
|
(and (client? client)
|
||||||
(while (not (stop-loop?))
|
(while (not (stop-loop?))
|
||||||
(iterate-simple-poll poll timeout)))))
|
(if timeout
|
||||||
|
(iterate-simple-poll poll timeout)
|
||||||
|
(iterate-simple-poll poll))))))
|
||||||
|
|
Reference in New Issue