1
0
Fork
You've already forked sigil-socket
0
TCP/UDP socket operations for Sigil.
  • Scheme 100%
Find a file
David Wilson 00cf9f932d
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Release 0.17.0: require Sigil ^0.17 for async DNS
The async-DNS wrapper depends on the resolver natives that shipped in
the Sigil 0.17.0 runtime (%resolve-start, %resolve-take,
%resolve-cancel, %tcp-connect-ip), so the compatibility floor moves to
^0.17. Lockfile re-pinned against the released v0.17.0 tag; build and
27/27 tests pass with the released 0.17.0 binary.
2026年06月11日 15:20:38 +03:00
docs docs: Add package documentation for sigil-socket and sigil-websocket 2026年02月19日 21:26:56 +02:00
src/sigil Use async DNS when a scheduler is active 2026年06月01日 12:36:42 +03:00
test Add unix-listen for Unix domain socket server support 2026年03月24日 05:27:54 +02:00
.gitignore Extract sigil-socket from sigil monorepo as standalone repo 2026年04月25日 22:40:06 +03:00
.woodpecker.yml Bump CI pin to sigil v0.14.3 2026年04月26日 20:17:59 +03:00
dev-redirects.sgl Extract sigil-socket from sigil monorepo as standalone repo 2026年04月25日 22:40:06 +03:00
manifest.scm Extract sigil-socket from sigil monorepo as standalone repo 2026年04月25日 22:40:06 +03:00
package.sgl Release 0.17.0: require Sigil ^0.17 for async DNS 2026年06月11日 15:20:38 +03:00
README.md Extract sigil-socket from sigil monorepo as standalone repo 2026年04月25日 22:40:06 +03:00
sigil.lock Release 0.17.0: require Sigil ^0.17 for async DNS 2026年06月11日 15:20:38 +03:00

sigil-socket

TCP, UDP, and Unix domain socket operations for Sigil. Provides network socket primitives suitable for both blocking and non-blocking I/O, including integration with Sigil's coroutine-based async runtime.

This package was extracted from the sigil monorepo — the in-tree history under packages/sigil-socket/ is preserved here as master.

Usage

(import (sigil socket))
;; TCP client
(let ((sock (tcp-connect "example.com" 80)))
 (socket-write-line sock "GET / HTTP/1.0")
 (socket-write-line sock "")
 (display (socket-read-all sock))
 (socket-close sock))
;; TCP server
(let ((server (tcp-listen 8080)))
 (let loop ()
 (let ((client (tcp-accept server)))
 (socket-write-line client "Hello!")
 (socket-close client)
 (loop))))
;; UDP
(let ((sock (udp-socket)))
 (udp-send sock "127.0.0.1" 5000 "Hello")
 (socket-close sock))

The full export list lives at the top of src/sigil/socket.sgl. See docs/socket.md for a usage guide.

Build & test

This is a pure-Scheme package. No native build step.

sigil deps install # fetch sigil-stdlib via codeberg:sigil/sigil-lang
sigil test --report # run test/test-socket.sgl

For local development against an unpublished sigil-lang, use dev-redirects.sgl (sibling checkout at ../sigil-lang/):

sigil deps install --redirects ./dev-redirects.sgl
sigil test --redirects ./dev-redirects.sgl --report

License

BSD-3-Clause. See the monorepo for the canonical license text.