pub struct Handoff { /* private fields */ }Expand description
What Binding::hand_over leaves for the
successor: the bound socket and the close packets held for its clients
(decisions/0039).
Handoff::into_parts splits it in two. The socket goes to the successor
as a descriptor, over SCM_RIGHTS or inherited across exec, and is
served there with Listener::bind_quic_socket.
The bytes go alongside it to
Binding::take_over. They are QUIC packets,
readable in the clear only as far as their headers go, and need no
secrecy.
They do need the integrity of their channel. Whoever can write them
decides what the successor sends from the binding’s UDP port, and to whom:
take_over sends each datagram it is given, once. That is bounded and not
harmless: it refuses more than 4096 datagrams, one larger than 1500
bytes, and a destination that is multicast, broadcast, unspecified or
port 0, none of which a client has — but within those bounds it sends
what it is told. The successor cannot check the destinations against
connections, because it has none: they were the predecessor’s. So carry
the bytes over the channel that carries the socket descriptor, which only
the two processes’ own user can reach, and not through a file or socket
other users can write.
A binding that holds more than 4096 datagrams keeps the first ones: the
clients whose close did not fit notice through Limits::idle_timeout and
redial on their normal schedule.
Implementations§
Source§impl Handoff
impl Handoff
Sourcepub fn local_addr(&self) -> SocketAddr
pub fn local_addr(&self) -> SocketAddr
The address the socket is bound to.
Sourcepub fn into_parts(self) -> (UdpSocket, Vec<u8>)
pub fn into_parts(self) -> (UdpSocket, Vec<u8>)
The socket, and the held datagrams as bytes for
Binding::take_over.