AtlatestRepositorysigil-socket
sigil-socket / treeREADME.md
1
# sigil-socket3
> **Archived at Sigil 0.19.0:** The maintained implementation now lives in4
> `codeberg:sigil/sigil`. This repository and all tags remain available for5
> provenance, but no further standalone releases will be published.7
TCP, UDP, and Unix domain socket operations for [Sigil](https://codeberg.org/sigil/sigil).8
Provides network socket primitives suitable for both blocking and non-blocking9
I/O, including integration with Sigil's coroutine-based async runtime.11
This package was extracted from the sigil monorepo — the in-tree history12
under `packages/sigil-socket/` is preserved here as `master`.14
## Usage16
```scheme17
(import (sigil socket))19
;; TCP client20
(let ((sock (tcp-connect "example.com" 80)))21
(socket-write-line sock "GET / HTTP/1.0")22
(socket-write-line sock "")23
(display (socket-read-all sock))24
(socket-close sock))26
;; TCP server27
(let ((server (tcp-listen 8080)))28
(let loop ()29
(let ((client (tcp-accept server)))30
(socket-write-line client "Hello!")31
(socket-close client)32
(loop))))34
;; UDP35
(let ((sock (udp-socket)))36
(udp-send sock "127.0.0.1" 5000 "Hello")37
(socket-close sock))38
```40
The full export list lives at the top of `src/sigil/socket.sgl`. See41
`docs/socket.md` for a usage guide.43
## Build & test45
This is a pure-Scheme package. No native build step.47
```bash48
sigil deps install # fetch sigil-stdlib via codeberg:sigil/sigil-lang49
sigil test --report # run test/test-socket.sgl50
```52
For local development against an unpublished sigil-lang, use53
`dev-redirects.sgl` (sibling checkout at `../sigil-lang/`):55
```bash56
sigil deps install --redirects ./dev-redirects.sgl57
sigil test --redirects ./dev-redirects.sgl --report58
```60
## License62
BSD-3-Clause. See the monorepo for the canonical license text.