             (and pending-write (:eof? pending-write))
             (let [fch (:from-channel pending-write)
                   tch (:to-channel pending-write)]
-              (.close fch)
-              (.close tch)
+              (.close fch)              ;this also causes removal of these
+              (.close tch)              ;channels from the selector
               (recur nil (dissoc downstreams-for-upstreams fch tch)))
 
-            ;; First deal with any unwritten buffer to/from the downstream.  We do not
+            ;; First deal with any unwritten buffer to/from the
+            ;; downstream.  We do not
             ;; get past this point until the in-flight buffer is disposed of
 
             pending-write

      (doto s1
        (.configureBlocking false)))))

(defn backend [serversocket host port finished-ch]
  (let [bytebuffer (ByteBuffer/allocate 8192)]
    (loop [pending-write false
           downstreams-for-upstreams {}]
      ;; BACKPRESSURE - we do things in a very specific order.  This is

                           s)
                         (Selector/open)
                         poll-set)]
    (doall ; have to force evaluation of this before closing selector
     (poll-selector bo timeout))))

(deftest poll-test
  (testing "timeout"
