mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-27 21:49:34 -05:00
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.
This commit is contained in:
parent
ba1fe203b2
commit
0ae419877c
1 changed files with 9 additions and 7 deletions
|
@ -49,11 +49,17 @@ (define-record-type* <avahi-service>
|
|||
(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.
|
||||
|
@ -89,10 +95,6 @@ (define (interface->ip-address interface)
|
|||
(close-port socket)
|
||||
ip))
|
||||
|
||||
(define never
|
||||
;; Never true.
|
||||
(const #f))
|
||||
|
||||
(define* (avahi-browse-service-thread proc
|
||||
#:key
|
||||
types
|
||||
|
@ -101,7 +103,7 @@ (define* (avahi-browse-service-thread proc
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue