2013-04-20 16:06:32 +02:00
|
|
|
(import [gevent.server [StreamServer]])
|
2013-03-28 01:09:42 +01:00
|
|
|
|
2013-03-28 01:52:06 +01:00
|
|
|
|
2013-03-28 01:09:42 +01: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 23:51:28 +02:00
|
|
|
(setv server (StreamServer (, "127.0.0.1" 5000) handle))
|
2013-03-28 01:09:42 +01:00
|
|
|
(.serve-forever server)
|