VENTI-SERVER(3)
β¨ NAME β¨
vtsrvhello, vtlisten, vtgetreq, vtrespond β Venti server energy. Okay so this is VENTI-SERVER(3) from the Library Functions Manual, and weβre doing the server-side bestie route π
πΈ SYNOPSIS πΈ
#include <u.h>
#include <libc.h>
#include <venti.h>
typedef struct VtReq
{
VtFcall tx;
VtFcall rx;
...
} VtReq;
int vtsrvhello(VtConn *z)
VtSrv* vtlisten(char *addr)
VtReq* vtgetreq(VtSrv *srv)
void vtrespond(VtReq *req)
π DESCRIPTION π
These routines execute the server side of the venti(7) protocol. Periodt. Theyβre the server-side girlies of the whole operation π«Ά
vtsrvhelloβ executes the server side of the initial hello transaction. It setsz->uidwith the user name claimed by the other side. Each new connection must be initialized by runningvtversionand thenvtsrvhello. The framework below takes care of this detail automatically;vtsrvhellois provided for programs that do not use the functions below.vtlisten,vtgetreq, andvtrespondβ provide a simple framework for writing Venti servers. Iconic little trio, no cap β¨
vtlisten announces at the network address addr, returning a fresh VtSrv structure representing the service. Itβs giving βnew server just droppedβ π
vtgetreq waits for and returns the next read, write, sync, or ping request from any client connected to the service srv. Hello and goodbye messages are handled internally and not returned to the client. The interface does not distinguish between the different clients that may be connected at any given time. The request can be found in the tx field of the returned VtReq.
Once a request has been served and a response stored in r->rx, the server should call vtrespond to send the response to the client. Vtrespond frees the structure r as well as the packets r->tx.data and r->rx.data. Cleanup queen behavior π
bestie, donβt sleep on thevtversion+vtsrvhelloorder β thatβs a must for every new connection π
π¦ EXAMPLE π¦
/src/venti/cmd contains two simple Venti servers ro.c and devnull.c written using these routines. Ro is a read-only Venti proxy (it rejects write requests). Devnull is a dangerous write-only Venti server: it discards all blocks written to it and returns error on all reads. Likeβ¦ literally read the danger warning, bestie π
π SOURCE π
/src/libventi
β SEE ALSO β
venti(3), venti-conn(3), venti-packet(3), venti(7), venti(8)
okay thatβs the whole page, bestie π source is /src/libventi, the footerβs only tag is VENTI-SERVER(3), and thereβs no date listed on this page β so thatβs all the sign-off info we got π«Άβ¨π
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms