Created
March 1, 2022 18:36
-
-
Save hiredman/0885c58b55b674770c277f6dab2eac73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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