 
 (defn setup
   [repl-env opts]
+  {:pre [(map? repl-env) (map? opts)]}
   (try
     (let [_ (set-logging-level "javax.jmdns" java.util.logging.Level/OFF)
           [bonjour-name endpoint] (discover-and-choose-device (:choose-first-discovered (:options repl-env)) opts)


(defn- set-up-socket
  [repl-env opts address port]
  (when-let [socket @(:socket repl-env)]
    (close-socket socket))
  (reset! (:socket repl-env)


(defn- mount-webdav
  [repl-env bonjour-name endpoint-address endpoint-port]
  {:pre [(map? repl-env) (is-ambly-bonjour-name? bonjour-name)
         (string? endpoint-address) (number? endpoint-port)]}
  (let [webdav-mount-point (str "/Volumes/Ambly-" (format "%08X" (hash bonjour-name)))
        output-dir (io/file webdav-mount-point)]
    (when (.exists output-dir)
