 
   protocols/Channel
   (close! [_]
-    (swap! closed (fn [closed]
-                    (if-not closed
-                      (do
-                        (nn/close! sock)
-                        (not closed))
-                      closed)))))
+    (close!-impl sock closed)))
 
 (defn chan
   "Channel constructor. Returns a core.async compatible

    (.recvBytes async-sock callback)
    nil))

(deftype NanomsgWriteChannel [sock closed]
  protocols/WritePort
  (put! [_ value fn1-handler]


  protocols/Channel
  (close! [_]
    (close!-impl sock closed)))

(deftype NanomsgReadChannel [sock closed]
  protocols/ReadPort
