Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaning up mire.clj to use duck-streams.

  • Loading branch information...
commit df141a4558b0e6183bb6488d9c816d1030c15fc3 1 parent 1c2e0d2
@technomancy authored
Showing with 9 additions and 11 deletions.
  1. +9 −11 src/mire.clj
View
20 src/mire.clj
@@ -1,17 +1,15 @@
#!/usr/bin/env clj
(ns mire
- (:use [clojure.contrib server-socket])
- (:import [java.io InputStreamReader OutputStreamWriter]
- [clojure.lang LineNumberingPushbackReader]))
+ (:use [clojure.contrib server-socket duck-streams]))
-(def port 3333)
+(def port (* 3 1111))
-(defn- mire-handle-client [ins outs]
- (binding [*in* (LineNumberingPushbackReader. (InputStreamReader. ins))
- *out* (OutputStreamWriter. outs)]
- (loop [input (read-line)]
- (println input)
- (recur (read-line)))))
+(defn mire-handle-client [in out]
+ (binding [*in* (reader in)
+ *out* (writer out)]
+ (loop []
+ (println (read-line))
+ (recur))))
-(defonce *server* (create-server port mire-handle-client))
+(def server (create-server port mire-handle-client))
Please sign in to comment.
Something went wrong with that request. Please try again.