<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -23,12 +23,11 @@
    directory).
 
    See also: `accept-authenticated-connection'&quot;
-  ([] (try
-       (let [slime-secret-file (File. (str (user-home-path) File/separator &quot;.slime-secret&quot;))]
-         (when (and (.isFile slime-secret-file) (.canRead slime-secret-file))
-           (with-open [secret (BufferedReader. (FileReader. slime-secret-file))]
-             (.readLine secret))))
-       (catch Throwable e nil))))
+  ([] (failing-gracefully
+        (let [slime-secret-file (File. (str (user-home-path) File/separator &quot;.slime-secret&quot;))]
+          (when (and (.isFile slime-secret-file) (.canRead slime-secret-file))
+            (with-open [secret (BufferedReader. (FileReader. slime-secret-file))]
+              (.readLine secret)))))))
 
 (defn- accept-authenticated-connection ;; rename to authenticate-socket, takes in a connection
   &quot;Accepts and returns new connection if it is from an authenticated
@@ -44,7 +43,7 @@
      (returning [conn (make-connection socket (get opts :encoding *default-encoding*))]
        (if-let [secret (slime-secret)]
          (when-not (= (read-from-connection conn) secret)
-           (.close socket))
+           (close-socket! socket))
          conn))))
 
 (defn- make-output-redirection
@@ -67,38 +66,35 @@
         (not dont-close)))))
 
 ;; Setup frontent
-(comment
-  (defn start-swank-socket-server!
-    &quot;Starts and returns the socket server as a swank host. Takes an
-  optional set of options as a map:
+(defn start-swank-socket-server!
+  &quot;Starts and returns the socket server as a swank host. Takes an
+   optional set of options as a map:
 
     :announce - an fn that will be called and provided with the
       listening port of the newly established server. Default: none.
 
     :dont-close - will accept multiple connections if true. Default: false.&quot;
-    ([server connection-serve] (start-swank-socket-server! connection-serve {}))
-    ([server connection-serve options]
-       (start-server-socket! server
-                             #(socket-serve connection-serve % options)
-                             (options :dont-close))
-       (when-let [announce (options :announce)]
-         (announce (.getLocalPort server)))
-       server)))
+  ([server connection-serve] (start-swank-socket-server! connection-serve {}))
+  ([server connection-serve options]
+     (start-server-socket! server
+                           connection-serve
+                           (options :dont-close))
+     (when-let [announce (options :announce)]
+       (announce (.getLocalPort server)))
+     server))
 
 (defn setup-server
   &quot;The port it started on will be called as an argument to (announce-fn
    port). A connection will then be created and (connection-serve conn)
    will then be called.&quot;
   ([port announce-fn connection-serve opts]
-     (let [server (make-server-socket {:port    port
-                                       :host    (opts :host)
-                                       :backlog (opts :backlog 0)})
-           port   (.getLocalPort server)]
-       (start-server-socket! server
-                             #(socket-serve connection-serve % opts)
-                             (opts :dont-close))
-       (announce-fn port)
-       port)))
+     (start-swank-socket-server!
+      (make-server-socket {:port    port
+                           :host    (opts :host)
+                           :backlog (opts :backlog 0)})
+      #(socket-serve connection-serve % opts)
+      {:announce announce-fn
+       :dont-close (opts :dont-close)})))
 
 ;; Announcement functions
 (defn simple-announce [port]</diff>
      <filename>src/swank/core/server.clj</filename>
    </modified>
    <modified>
      <diff>@@ -59,3 +59,8 @@
 
 (defmacro continuously [&amp; body]
   `(loop [] ~@body (recur)))
+
+(defmacro failing-gracefully [&amp; body]
+  `(try
+    ~@body
+    (catch Throwable _# nil)))
\ No newline at end of file</diff>
      <filename>src/swank/util.clj</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c5b50cf4b3eab8af9d814779e86f7d4cbb9570dc</id>
    </parent>
  </parents>
  <author>
    <name>Jeffrey Chu</name>
    <email>jochu0@gmail.com</email>
  </author>
  <url>http://github.com/jochu/swank-clojure/commit/3e0a9823f1be5503132c2243fb846e810e0cc76d</url>
  <id>3e0a9823f1be5503132c2243fb846e810e0cc76d</id>
  <committed-date>2009-09-30T20:13:17-07:00</committed-date>
  <authored-date>2009-09-30T20:13:17-07:00</authored-date>
  <message>start server refactoring</message>
  <tree>3a60b9cc7cd90a76bc3a1ae86b440c5c29de57b9</tree>
  <committer>
    <name>Jeffrey Chu</name>
    <email>jochu0@gmail.com</email>
  </committer>
</commit>
