modus

The program quic_echo

A QUIC echo server (docs/QUIC.md, section 6): QUIC in the program (support/quic), over a datagram endpoint with a listen grant of UDP. A client opens up to STREAMS_PER_CONNECTION streams at one time; on each one the server writes back each byte that it reads, then ends the stream after the client ended it, or resets it after the client reset it.

What it can reach comes from its grants only:

a datagram endpoint with a listen grant: the UDP port 4433, and the

remotes that send a datagram of 1200 bytes to it;

the module cryptography, through its import slots.

The key of the server: an Ed25519 key that this program makes at its start from its own generator (fill_for_a_key, the strength "processor" at least). Its public key goes on the log and in the window: a client pins it. The private key stays in the memory of this program; a new start makes a new key. A seed weaker than "processor" makes no key: the program says so in its window, and listens on nothing.

main.odin: the endpoint, the server and the loop. draw.odin: the window.

FactValue
Sourceprograms/quic_echo
Boot imagein the boot image; the image is not built, so its size is not known
Importscryptography
Imported bynone

Exports

ExportWhat it does
entry()

Read from the source of the module, as the build reads it to describe the exports (tools/kerneltool/describe.odin).

What the root service gives it

WhatValueAs the root service says
Grants{.Network}A listen grant of UDP: QUIC in the program, the module cryptography through its imports.
Budget: pages, programs, threads{pages = 4096, programs = 1, threads = 1}16 QUIC connections of about 85 KiB each, 4 streams of about 130 KiB for each, and an echo buffer of 16 KiB for each stream: about 2770 pages, in one mapping of the program (docs/QUIC.md, section 6).

Read from grants_of and things_of in programs/root/main.odin; budget_of in the same file adds the limits of processor time and of log records.