tcp-server/client a bit improved

This commit is contained in:
2021-11-05 15:27:21 +01:00
parent 159845bb9b
commit 865e198a5b
6 changed files with 85 additions and 47 deletions

View File

@@ -1,11 +1,17 @@
(thread-create
(tcp-server 7777 (lambda (str) (list #t (+ "(print \"" (string-upcase str) "\")"))))
(tcp-server 7777 (lambda (str) (list #f (+ "(print \"" (string-upcase str) "\")"))))
)
(thread-sleep 1)
(thread-create
(define code (tcp-client "127.0.0.1" 7777 ("abcd" "xyz")))
(for c code
(print "executing code:" c)
(eval (parse c))
)
(define code (tcp-client "127.0.0.1" 7777 "abcd"))
(print "executing code:" code)
(eval (parse code))