mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Initial file
This commit is contained in:
parent
973a0672f2
commit
c980126f23
2 changed files with 17 additions and 0 deletions
5
examples/networking/client.scm
Normal file
5
examples/networking/client.scm
Normal file
|
@ -0,0 +1,5 @@
|
|||
(import (scheme base) (scheme write) (106))
|
||||
|
||||
(define s (make-client-socket "localhost" "12345"))
|
||||
(socket-send s (string->utf8 "hello from client"))
|
||||
(socket-close s)
|
12
examples/networking/server.scm
Normal file
12
examples/networking/server.scm
Normal file
|
@ -0,0 +1,12 @@
|
|||
(import (scheme base) (scheme write) (106))
|
||||
|
||||
(define svr (make-server-socket "12345"))
|
||||
|
||||
(let* ((s (socket-accept svr))
|
||||
(data (socket-recv s 1024)))
|
||||
(display `("received: " ,(utf8->string data)))
|
||||
(newline)
|
||||
(socket-close s))
|
||||
|
||||
(socket-close svr)
|
||||
|
Loading…
Add table
Reference in a new issue