Skip to content

Instantly share code, notes, and snippets.

@hiredman
Created March 1, 2022 18:36
Show Gist options
  • Save hiredman/0885c58b55b674770c277f6dab2eac73 to your computer and use it in GitHub Desktop.
Save hiredman/0885c58b55b674770c277f6dab2eac73 to your computer and use it in GitHub Desktop.
(let [addr (java.net.UnixDomainSocketAddress/of "/tmp/222")
sc (doto (java.nio.channels.ServerSocketChannel/open java.net.StandardProtocolFamily/UNIX)
(.bind addr))]
(while true
(let [c (.accept sc)]
(future
(let [in (java.nio.channels.Channels/newInputStream c)
out (java.nio.channels.Channels/newOutputStream c)]
(binding [*in* (clojure.lang.LineNumberingPushbackReader.
(clojure.java.io/reader in))
*out* (clojure.java.io/writer out)]
(clojure.main/repl)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment