2013-04-20 16:06:32 +02:00
|
|
|
(import [gevent.server [StreamServer]])
|
2013-03-27 20:09:42 -04:00
|
|
|
|
2013-03-27 20:52:06 -04:00
|
|
|
|
2013-03-27 20:09:42 -04:00
|
|
|
(defn handle [socket address]
|
|
|
|
(.send socket "Hello from Lisp!\n")
|
|
|
|
(for [x (range 5)] (.send socket (+ (str x) "\n")))
|
|
|
|
(.close socket))
|
|
|
|
|
|
|
|
|
2013-04-01 16:51:28 -05:00
|
|
|
(setv server (StreamServer (, "127.0.0.1" 5000) handle))
|
2013-03-27 20:09:42 -04:00
|
|
|
(.serve-forever server)
|