Skip to main content

Module udp_transport

Module udp_transport 

Source
Expand description

SessionTransport impls over raw UDP (PhantomUDP). UdpClientTransport is an unconnected-socket client (it send_tos a tracked server address and recv_froms any source, so it can hear — and later follow — a server that migrates to a new address); UdpServerTransport is a per-session shim fed by the listener demux that can migrate its own send socket. Both add / strip the outer [flags][cid] envelope exactly as TcpSessionTransport adds / strips its 4-byte length prefix, so run_data_pump / run_client_handshake / drive_server_handshake are reused.

Structs§

UdpClientTransport
UdpServerTransport
Per-session server transport. The listener’s demux task reassembles inbound datagrams and pushes the inner frames to rx; outbound frames are enveloped and sent to the captured peer from send_socket. A server migration (migrate_to) swaps send_socket to a freshly-bound local socket (so the client sees a new s2c source) and spawns a recv loop on it that feeds the SAME rx channel via tx, so the client’s c2s frames are delivered transparently once it switches its send target — while the listener demux keeps feeding rx on the old address during the overlap.