 (ns cbfg.net
-  (:require-macros [cbfg.ago :refer [achan ago-loop aclose aalts aput]]))
+  (:require-macros [cbfg.ago :refer [achan ago-loop aclose aalts aput aput-close]]))
 
 (defn make-net [actx request-listen-ch request-connect-ch max-msgs-per-stream]
   (let [clean-up #()]

                           server-send-ch (achan net)
                           server-recv-ch (achan net)]
                       ; TODO: Need to model connection delay and running out of ports.
                       (aput net result-ch [client-send-ch client-recv-ch])
                       (aput net accept-ch [server-send-ch server-recv-ch])
                       (recur (inc ts) request-listen-ch request-connect-ch listens

                                       (when (< (count (:msgs stream)) max-msgs-per-stream)
                                         [(:send-ch stream)]))
                                      streams)
                    [v ch] (aalts net (vec (concat [request-listen-ch request-connect-ch]
                                                   deliveries sendables)))]
                (cond
                 (= ch request-listen-ch)
                 (when-let [[addr port accept-ch] v]
