diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-17 00:44:58 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-17 10:06:26 -0300 |
| commit | 67fa2a1f2e6057bbce7441a16ebab84848f623ae (patch) | |
| tree | 515f38c20566fb14f126d057fb7ad11f14349c96 /9ns/src | |
| parent | 0702e33bcfadf0abd9ccbaa8b681a19a84c332fe (diff) | |
| download | cloud9-67fa2a1f2e6057bbce7441a16ebab84848f623ae.tar.gz cloud9-67fa2a1f2e6057bbce7441a16ebab84848f623ae.zip | |
Fsys: a blocking client on a socket, by path, with the server's words
Every program that serves a cloud9 tree should be drivable through it from
its own binary and from agents, and pardes, 9ns and pardes's Python tests
each carried a blocking client of their own. Fsys is the one the library
lacked, plan9port's lib9pclient over `Client`: dial a name posted in the
registry (a subdirectory entry such as pardes/main included), unix!PATH or
tcp!HOST!PORT; open, create, remove, stat, read, write and clunk by path and
fid; readFile, writeFile and ask (write, then read the answer on the same
open from the start, as Plan 9 reads /net/cs) streaming into a
std.Io.Writer, flushed per answer, so an event file whose reads park streams as it comes. A refusal is
error.Refused and said() holds the server's words, which a mount would have
turned into an errno.
Taken from pardes's Client (src/9p_io.zig): the walk sent ahead of the
request that uses its fid, the clunk not waited for, and the answers of
both checked or dropped on the way to the request's, so an open, a stat or
a remove is one round trip; error words kept as the server said them. Not
taken: its kept-connection table, flights of read-ahead, the stat-length
end of file and its pardes-only dials. From 9ns: the chunked read/write
loops and the iounit. Buffers inline (2 x 64 KiB), no allocator, std.Io
streams only, so it builds without libc.
TestTree.zig is a small tree on serve.Runner for these tests and the next
change's. Tests over a Unix socket and TCP against cloud9's own engine:
whole files longer than a message, stats, walks longer than 16 names, a
missing first name and a walk short of its names refused in the server's
words, a refused write whose words reach the caller, a short read that is
not the end, ask, a held read streaming three chunks flushed one at a time,
a server that hangs up mid-read, create and remove, a directory decoded as
entries, dial by posted name and a name that climbs out of the registry.
Diffstat (limited to '9ns/src')
0 files changed, 0 insertions, 0 deletions
