Closed nurmohammed840 closed 1 year ago
The problem is that the connection is no longer being driven (polled), so connection frames won't be sent/received. You typically need to spawn a new task for each new request you accept
.
Ah! I see...
So the solution is to spawn a new task:
tokio::spawn(async move {
let mut total_len = 0;
while let Some(Ok(bytes)) = body.data().await {
total_len += bytes.len();
println!("\nrecv: {:?} bytes, total = {}", bytes.len(), total_len);
let _ = body.flow_control().release_capacity(bytes.len());
}
});
I am trying to send
1MB
of data, But server only received 65535 bytes,Here is my setup:
Cargo.toml
:Server
Client
Output
We can see that, server didn't send
WINDOW_UPDATE
frames. What am I doing wrong ?