Skip to main content

splice

Function splice 

Source
pub async fn splice<A, B>(a: &mut A, b: &mut B) -> Result<(u64, u64), Error>
Expand description

Copies bytes both ways until one side closes, then returns.

Used for the post-101 tail of an upgraded connection. copy_bidirectional rather than two hand-rolled loops: it already handles the half-close case where one direction ends while the other still has data, which is the case a naive select! loop truncates.