1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-14 12:44:49 +00:00
janet/examples/tcpclient.janet
Calvin Rose f4a46ba6ea Add methods to streams.
This makes streams polymorphic with files in many cases.
printf family functions still need porting.
2020-02-12 09:32:41 -06:00

7 lines
184 B
Clojure

(with [conn (net/connect "127.0.0.1" "8000")]
(printf "Connected to %q!" conn)
(:write conn "Echo...")
(print "Wrote to connection...")
(def res (:read conn 1024))
(pp res))