Expand description
Socket helpers: name resolution and UDP socket setup.
Resolution is deliberately explicit rather than left to
TcpStream::connect’s implicit lookup. Two later requirements depend on
seeing the resolved addresses:
- RFC 9298 §3.1 requires a CONNECT-UDP request to be resolved before the 2xx response is sent.
- The destination ACL (M4) can only filter what it can see.
Structs§
- Connection
Resolver - What one connection may ask the resolver to do at once.
- Resolver
Budget - The server’s share of the blocking pool, handed out one connection at a time.
Constants§
- BURST_
LOOKUPS - Lookups one connection may take from
SHARED_LOOKUPSat once. - LOOKUP_
FREE_ THREADS - Blocking threads the pool keeps clear of name resolution.
- RESERVED_
LOOKUP_ CEILING - Connections the blocking pool is sized to reserve a lookup slot for.
- SHARED_
LOOKUPS - Name lookups the whole process may have in flight beyond the one every connection keeps in reserve.
Functions§
- blocking_
pool_ size - The blocking pool the runtime is built with, in threads.
- connected_
udp_ socket - Binds a UDP socket and connects it to
target. - fd_
limits - The process’s
RLIMIT_NOFILE, soft limit first and hard limit second. - fd_
soft_ limit - The process’s soft limit on open file descriptors, or
Noneif it has none. - holds_
address - Whether this host holds
ip, meaning a socket of this process may be bound to it. - max_
open_ files - The
Max open filesrow of a/proc/<pid>/limitsfile, soft limit first. - prefer_
family - Reorders
addressesso the preferred address family comes first. - resolve
- Resolves
host/portto a non-empty list of socket addresses.