np_queue made a NetMsg and a buffer per message, every flush a new keep list, and every message that came in a NetMessage and a buffer; nr_text a new string per text read. A party plays at dozens a second, so all of it is kept now: a pool of MTU-sized records for the queue (a peer's two lists swapped by the flush), the inbox's records in two halves swapped when a message finds the inbox empty, net_written's one record, a relay hello's and a STUN request's bytes in one scratch buffer, and the texts read out interned. Tests: 6000 messages with the heap flat (Os.heap_bytes), and an inbox record that holds still across a drain and comes back two drains on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
22 lines
615 B
Text
22 lines
615 B
Text
# ludic.net - the transport a party plays over: what a message says and what each kind means are
|
|
# the game's; getting it there, once, in order, through two home routers, is this
|
|
module ludic_net uses ludic_base
|
|
numbers float
|
|
import "ludic.base"
|
|
import "state.ludic"
|
|
import "ports.ludic"
|
|
import "codec.ludic"
|
|
import "peers.ludic"
|
|
import "pool.ludic"
|
|
import "send.ludic"
|
|
import "receive.ludic"
|
|
import "session.ludic"
|
|
import "tick.ludic"
|
|
import "queries.ludic"
|
|
import "codes.ludic"
|
|
import "stun.ludic"
|
|
import "room.ludic"
|
|
import "room_connect.ludic"
|
|
import "room_tick.ludic"
|
|
import "punch.ludic"
|
|
import "relay.ludic"
|