    (let [cls        (-> socktype supported-sockets)
          instance   (.newInstance cls)
          conn       (if (:async opts)
-                      (->AsyncConnection instance (AsyncSocketProxy. instance))
+                      (->AsyncConnection instance (AsyncSocket. instance))
                       (->Connection instance))]
      (cond
        (:bind opts) (bind! conn (:bind opts))


(defrecord AsyncConnection [s px]
  INNSocket

  (bind! [_ endpoint]
    (.bind s endpoint))
  (connect! [_ endpoint]

           (nanomsg.pair PairSocket)
           (nanomsg.bus BusSocket)
           (nanomsg ISocket Socket Nanomsg Device)
           (nanomsg.async IAsyncCallback AsyncSocket))
  (:require [clojure.core.async :refer [chan put!]]))

(def ^:static ^:private supported-sockets
