Files
gt4carp/carp/src/languagelink.carp
Veit Heller 6369d15e93 Multiple changes:
- Move to a Python process for the LanguageLink client [fixes #1, presumably]
- Finish a first rough draft of the booklet [fixes #4]
2022-06-11 18:43:17 +02:00

18 lines
560 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(load "/Users/veitheller/Documents/Code/Github/carp/archive/socket/sockets.carp")
(use Socket)
(defn main []
(let-do [port (Maybe.from (from-string &(Maybe.from (nth &System.args 1) @"")) 0)]
(IO.println &(fmt "Starting server on localhost, port %d" port))
(Socket.with-server sock "127.0.0.1" port
(if (Socket.valid? &sock)
(Socket.while-connection &sock client
(IO.println &(read &client))
(send &client "hi")
(IO.println "yay"))
(IO.errorln "Server couldnt be started.")))))
(build)
(run)