       v)))
 
 (defn poll-channels [poll-set timeout]
-  (with-open [bo (reduce (fn [s [channel & ops]]
-                           (.register channel s (poll-ops-mask ops))
-                           s)
-                         (Selector/open)
-                         poll-set)]
+  (with-open [^Selector bo (reduce (fn [s [channel & ops]]
+                                     (.register channel s (poll-ops-mask ops))
+                                     s)
+                                   (Selector/open)
+                                   poll-set)]
     (doall ; have to force evaluation of this before closing selector
      (poll-selector bo timeout))))
 

            ;; our selector, so we can finish up serving the requests we already
            ;; started but will not pick up any new connections
            (async/poll! finished-ch)
            (let [key (first (filter #(= serversocket (.channel %))
                                     (.keys selector)))]
              ;; if the serversocket has been closed already (e.g. by another
              ;; thread when the listen-address is changed) then it will not
              ;; appear in this selector

  (.getTime (java.util.Date.)))

(defn write-pending-buffer [w]
  (let [ch ^SocketChannel (:to-channel w)
        b ^ByteBuffer (:buffer w)]
    (if (:eof? w)
      w
      (do
