1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
(use zmq srfi-18 posix)
(define s (make-socket 'rep))
(bind-socket s "tcp://127.0.0.1:5563")
(print "Start server...")
(let loop ()
(let* ((msg (receive-message s))
(name (caddr (string-split msg " ")))
(resp (conc "World " name)))
(print "Received request: [" msg "]")
(thread-sleep! 0.01)
(print "Sending response \"" resp "\"")
(send-message s resp)
(loop)))
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
(use zmq srfi-18 posix)
(define s (make-socket 'rep))
(bind-socket s "tcp://*:5563")
(print "Start server...")
(let loop ()
(let* ((msg (receive-message s))
(name (caddr (string-split msg " ")))
(resp (conc "World " name)))
(print "Received request: [" msg "]")
(thread-sleep! 0.0001)
(print "Sending response \"" resp "\"")
(send-message s resp)
(loop)))
|