Permalink
Browse files

close the server socket before individual transports

  • Loading branch information...
cemerick committed Oct 3, 2012
1 parent bf7e5dc commit 2bdfd618095a6ef3589bd0f289ebab48a1727a1f
@@ -53,6 +53,7 @@
"Stops a server started via `start-server`."
[{:keys [open-transports ^ServerSocket server-socket] :as server}]
(returning server
+ (.close server-socket)
(swap! open-transports #(reduce
(fn [s t]
; should always be true for the socket server...
@@ -61,8 +62,7 @@
(safe-close t)
(disj s t))
s))
- % %))
- (.close server-socket)))
+ % %))))
(defn unknown-op
"Sends an :unknown-op :error for the given message."
@@ -217,6 +217,7 @@
(def-repl-test ensure-server-closeable
(.close *server*)
+ ;(println "wha?" (connect :port (:port *server*)))
(is (thrown? java.net.ConnectException (connect :port (:port *server*)))))
; wasn't added until Clojure 1.3.0

0 comments on commit 2bdfd61

Please sign in to comment.