(write-line 2 (format "** No handler %s for:\n%s" KEY (string MSG))))
(define (process-message MSG)
- ;;(die nil (list 'process-message MSG))
(let ((KEY (message-key MSG)))
- ;;(die nil "Dbus:process-message" KEY (and (RECV KEY) true))
(if (RECV KEY) ($it (lookup "" MSG))
(no-handler KEY MSG))))
;; asyncronous events
(define (main-loop S)
(let ((FDS (list 0 (:%socket SYSTEM-BUS))) (FD nil))
- ;;(die nil "Dbus:main-loop" (length pending) "pending")
(write 2 (string "> "))
(while (or pending (not (member 0 (net-select FDS "r" -1))))
(if (pop pending) (process-message $it)
;; Send message, then keep reading messages until there is a reply
(define (send-recv-message MSG)
- ;;(die nil (list 'send-recv-message (octals-string MSG)))
(net-send (:%socket SYSTEM-BUS) MSG)
(let ((REPLY nil))
(while (nil? REPLY)