in netbench/src/multiplex.rs [372:393]
fn poll_receive(
&mut self,
owner: Owner,
id: u64,
bytes: u64,
cx: &mut Context,
) -> Poll<Result<u64>> {
let stream = self.streams[owner]
.get_mut(&id)
.ok_or("missing stream")?
.rx
.as_mut()
.ok_or("missing rx stream")?;
let len = ready!(stream.receive(bytes, cx))?;
if stream.receive_window() < self.config.stream_window / 2 {
self.max_stream_data.insert((owner, id));
}
Ok(len).into()
}