wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
Loading...
Searching...
No Matches
srvinbox.h
Go to the documentation of this file.
1#ifndef WIRED_SRVINBOX_SRVINBOX_H
2#define WIRED_SRVINBOX_SRVINBOX_H
3
5
24
27#define WIRED_SRVINBOX_DEPTH 4u
28
31#define WIRED_SRVINBOX_SLOT_MAX 1200u
32
38
51
54
67
82
83#endif
#define WIRED_SRVINBOX_SLOT_MAX
Max payload bytes one slot holds – sized for one QUIC datagram (srvrun's own dg_pending_buf is 1200 b...
Definition srvinbox.h:31
void wired_srvinbox_ring_init(wired_srvinbox_ring *r)
Zero-initialize r (prod = cons = 0, empty ring).
int wired_srvinbox_push(wired_srvinbox_ring *r, const u8 *data, usz len)
Push one message (producer side only).
usz wired_srvinbox_pop(wired_srvinbox_ring *r, u8 *out_buf, usz out_cap)
Pop one message (consumer side only) into out_buf.
#define WIRED_SRVINBOX_DEPTH
Ring capacity; must stay a power of two (WIRED_SRVINBOX_DEPTH - 1 is used as the index mask).
Definition srvinbox.h:27
A single-producer/single-consumer ring of depth WIRED_SRVINBOX_DEPTH.
Definition srvinbox.h:46
u32 cons
free-running release counter, consumer-owned
Definition srvinbox.h:49
u32 prod
free-running publish counter, producer-owned
Definition srvinbox.h:48
wired_srvinbox_slot slots[WIRED_SRVINBOX_DEPTH]
ring storage
Definition srvinbox.h:47
One ring slot: a datagram payload and its length.
Definition srvinbox.h:34
usz len
valid byte count in buf
Definition srvinbox.h:36
u8 buf[WIRED_SRVINBOX_SLOT_MAX]
payload bytes
Definition srvinbox.h:35
Linux direct syscalls.
unsigned int u32
unsigned 32-bit integer
Definition types.h:15
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned char u8
unsigned 8-bit integer / byte
Definition types.h:18