     (loop [recvd 0]
       (if (= recvd len)
         samples
-        (let [msg (recv-and-wait "/b_setn")
+        (let [msg @(recv "/b_setn")
               ;_ (println "b_setn msg: " (take 3 (:args msg)))
               [buf-id bstart blen & samps] (:args msg)]
           (loop [idx bstart

  (let [sync-id (rand-int 999999)
        reply-p (recv "/synced")
        _ (snd "/sync" sync-id)
        reply (read-reply reply-p (if timeout timeout REPLY-TIMEOUT))
        reply-id (first (:args reply))]
    (= sync-id reply-id)))


    (on path #(do (deliver p %) :done))
    p))

(defn await-promise
    "Read the reply received from the server, waiting for timeout ms if the message hasn't yet been received. Returns :timeout if a timeout occurs."
    ([prom] (await-promise msg REPLY-TIMEOUT))
    ([prom timeout]
       (try
         (.get (future @msg) timeout TimeUnit/MILLISECONDS)
         (catch TimeoutException t
           :timeout))))

(defn- parse-status [args]
  (let [[_ ugens synths groups loaded avg peak nominal actual] args]
