 
 (defn connect
   "Takes: server - host ip to connect to
-          port   - port to connect to"
+          port   - port to connect to
+  and returns a map of channels to read/write to
+  and a raw socket"
   [server port]
   (let [socket (Socket. server port)
         in (-> socket

    ; shut down server
    (println "Shutting down server...\n")
    (do
      (>!! send-chan 0)
      (<!! (timeout 200))
      (reset! (:running server) false)
      (mapv #(.close %) connected)
      (a/close! send-chan)

                (when @running?
                  (do
                    (alt! [client-in] ([msg] (write sock (@handler msg)))
                          [send-chan] ([msg] (doall (map #(write % msg) @connected))))
                    (recur))))))))
      (catch Exception e nil))
    (go-loop []
