Skip to main content

accept_with_retry

Function accept_with_retry 

Source
pub fn accept_with_retry<F: BufFactory>(
    scid: &ConnectionId<'_>,
    retry_cids: RetryConnectionIds<'_>,
    local: SocketAddr,
    peer: SocketAddr,
    config: &mut Config,
) -> Result<Connection<F>>
Expand description

Creates a new server-side connection after the client responded to a Retry packet.

To generate a Retry packet in the first place, use the retry() function.

The scid parameter represents the server’s source connection ID, which can be freshly generated after the application has successfully verified the Retry. retry_cids is used to tie the new connection to the Initial + Retry exchange that preceded the connection’s creation.

The DCID of the client’s Initial packet is inherently untrusted data. It is safe to use the DCID in the retry_source_cid field of the RetryConnectionIds provided to this function. However, using the Initial’s DCID for the scid parameter carries risks. Applications are advised to implement their own DCID validation steps before using the DCID in that manner.