You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moving the conversation from #1 here; @dignifiedquire proposed we build an HTTP client like so:
asyncfnmain() -> throws{let tcp_stream = net::TcpStream::connect("127.0.0.1:8080").await?;let(tcp_reader, tcp_writer) = &mut(&tcp_stream,&tcp_stream);let http_stream = client::connect(tcp_reader);// lets make 10 requests, with the same connectionfor i in0..10{// Send a responselet body = Body::from(format!("hello chashu {}", i));letmut req = client::encode(Request::new(body));
tcp_writer.write_all(req).await?;// read the responselet res = http_stream.next().await?;println!("Response {}: {:?}", i, res);}}
The text was updated successfully, but these errors were encountered:
Moving the conversation from #1 here; @dignifiedquire proposed we build an HTTP client like so:
The text was updated successfully, but these errors were encountered: