Overview
Context
Changes
Added ulex-trials/server-one.scm version [aaab534b38].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
(require-extension tcp-server format (chicken tcp) (chicken io) (chicken string) sql-de-lite srfi-18 simple-exceptions)
(let* ((th1 (make-thread (lambda ()
((make-tcp-server
(tcp-listen 6505)
(lambda ()
(let* ((db (open-database "test.db"))
(rec-data (read-line)))
(exec (sql db "INSERT INTO entries (received,send) VALUES (?,?);") rec-data (conc "Server One Response: " rec-data))
(format (current-error-port) rec-data)
(write-line (conc "Response to: " rec-data))
(close-database db)
)))
#t))
"Ulex command loop"))
(th2 (make-thread (lambda ()
(print "Jeff is here")
(let loop ((entries 0))
(thread-sleep! 0.05)
(print "Preparding to send entries" entries)
(handle-exceptions exn (begin (print "Had an issue: " (message exn))(thread-sleep! 10))
(define-values (i o) (tcp-connect "localhost" 6504))
(write-line (conc "entries" entries) o)
(print (read-line i))
(close-input-port i)
(close-output-port o))
(loop (+ entries 1)))) "jeff")))
(thread-start! th1)
(thread-start! th2)
(thread-join! th2)
)
(print "Done here")
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added ulex-trials/server-two.scm version [d6dd6aa922].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
(require-extension tcp-server format (chicken tcp) (chicken io) (chicken string) sql-de-lite srfi-18 simple-exceptions)
(let* ((th1 (make-thread (lambda ()
((make-tcp-server
(tcp-listen 6504)
(lambda ()
(let* ((db (open-database "test.db"))
(rec-data (read-line)))
(exec (sql db "INSERT INTO entries (received,send) VALUES (?,?);") rec-data (conc "Server Two Response: " rec-data))
(format (current-error-port) rec-data)
(write-line (conc "Response to: " rec-data))
(close-database db)
)))
#t))
"Ulex command loop"))
(th2 (make-thread (lambda ()
(print "Jeff is here")
(let loop ((entries 500))
(thread-sleep! 0.01)
(print "Preparing to send entries" entries)
(handle-exceptions exn (begin (print "Had an issue: " (message exn))(thread-sleep! 10))
(define-values (i o) (tcp-connect "localhost" 6505))
(write-line (conc "entries" entries) o)
(print (read-line i))
(close-input-port i)
(close-output-port o))
(loop (+ entries 1)))) "jeff")))
(thread-start! th1)
(thread-start! th2)
(thread-join! th2)
)
(print "Done here")
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |