                            s)
                          (Selector/open)
                          poll-set)]
-    (if-not (zero? (.select bo timeout))
-      (let [ready (.selectedKeys bo)]
-        (doall ; have to force evaluation of this before closing selector
-         (map (fn [k]
-                {:channel (.channel k)
-                 :ops (.readyOps k)})
-              ready))))))
+    (doall ; have to force evaluation of this before closing selector
+     (poll-selector bo timeout))))
 
 (deftest poll-test
   (testing "timeout"

            upstreams (set (keys downstreams-for-upstreams))
            upstreams-for-downstreams
            (set/map-invert downstreams-for-upstreams)
            poll-set
            (if pending-write
              [[(:to-channel pending-write) :write]]
              (concat (map #(vector % :read ) downstreams)
                      (map #(vector % :read ) upstreams)
                      [[serversocket :accept]]))]
        (let [ready (poll-channels poll-set 1000)
              ready-channels (set (map :channel ready))
              readable-ds
              (first (filter (fn [s]

            ;; Note this may block in connect(), I haven't decided if that's
            ;; bad or not
            (get ready-channels serversocket)
            (if-let [sock (accept-connection serversocket)]
              (let [ds (doto (SocketChannel/open)
                         (.connect (InetSocketAddress. host port))
                         (.configureBlocking false))
                    mask (poll-ops-mask [:read])]
                (.register sock selector mask)
                (.register ds selector mask)
                (recur nil (assoc downstreams-for-upstreams sock ds)))
              (recur nil downstreams-for-upstreams))

            :default
            (recur pending-write downstreams-for-upstreams)
            ))))))


