Skip to content
This repository has been archived by the owner on Oct 21, 2021. It is now read-only.

Commit

Permalink
Cleaning up mire.clj to use duck-streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Jan 27, 2009
1 parent 1c2e0d2 commit df141a4
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/mire.clj
@@ -1,17 +1,15 @@
#!/usr/bin/env clj #!/usr/bin/env clj


(ns mire (ns mire
(:use [clojure.contrib server-socket]) (:use [clojure.contrib server-socket duck-streams]))
(:import [java.io InputStreamReader OutputStreamWriter]
[clojure.lang LineNumberingPushbackReader]))


(def port 3333) (def port (* 3 1111))


(defn- mire-handle-client [ins outs] (defn mire-handle-client [in out]
(binding [*in* (LineNumberingPushbackReader. (InputStreamReader. ins)) (binding [*in* (reader in)
*out* (OutputStreamWriter. outs)] *out* (writer out)]
(loop [input (read-line)] (loop []
(println input) (println (read-line))
(recur (read-line))))) (recur))))


(defonce *server* (create-server port mire-handle-client)) (def server (create-server port mire-handle-client))

0 comments on commit df141a4

Please sign in to comment.