hy/eg/gevent/sockets/socket-server.hy
Christopher Allan Webber 1b60bee8a3 Change all instances of (def foo bar) to (setv foo bar)!
I'm in ur base polluting your language with all my opinions!
2013-04-01 16:51:28 -05:00

12 lines
267 B
Hy

(import-from gevent.server StreamServer)
(defn handle [socket address]
(.send socket "Hello from Lisp!\n")
(for [x (range 5)] (.send socket (+ (str x) "\n")))
(.close socket))
(setv server (StreamServer (, "127.0.0.1" 5000) handle))
(.serve-forever server)