168
169
170
171
172
173
174
175
176
177
178
179
180
181
|
(lambda ()
(let loop ()
(let ((dat (server:receive rep)))
(set! last-msg-time (current-seconds))
;; (print "received: " pktdat)
(if (not (eof-object? dat))
(let ((resdat (proc dat)))
(nmsg:send rep (with-output-to-string (lambda ()(write resdat))))
(loop))))))
"message handler"))
(th2 (make-thread
(lambda ()
(let loop ()
(thread-sleep! 10)
|
>
>
|
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
(lambda ()
(let loop ()
(let ((dat (server:receive rep)))
(set! last-msg-time (current-seconds))
;; (print "received: " pktdat)
(if (not (eof-object? dat))
(let ((resdat (proc dat)))
(print "Got " dat)
(print "Responding with " resdat)
(nmsg:send rep (with-output-to-string (lambda ()(write resdat))))
(loop))))))
"message handler"))
(th2 (make-thread
(lambda ()
(let loop ()
(thread-sleep! 10)
|