mirror of
https://github.com/n0-computer/noq.git
synced 2026-10-03 12:40:46 +00:00
deploy: 6cfb8c4475
This commit is contained in:
+2
-2
@@ -526,8 +526,8 @@ For example, from the connection initiator to the peer and the other way around.
|
||||
<span class="boring">#![allow(unused)]
|
||||
</span><span class="boring">fn main() {
|
||||
</span>async fn receive_bidirectional_stream(mut connection: NewConnection) -> anyhow::Result<()> {
|
||||
while let Some(Ok((send, recv))) = connection.bi_streams.next().await {
|
||||
// Because it is a bidirectional stream, we can both send and recieve.
|
||||
while let Some(Ok((mut send, recv))) = connection.bi_streams.next().await {
|
||||
// Because it is a bidirectional stream, we can both send and receive.
|
||||
println!("request: {:?}", recv.read_to_end(50).await?);
|
||||
|
||||
send.write_all(b"response").await?;
|
||||
|
||||
@@ -179,8 +179,8 @@ For example, from the connection initiator to the peer and the other way around.
|
||||
<span class="boring">#![allow(unused)]
|
||||
</span><span class="boring">fn main() {
|
||||
</span>async fn receive_bidirectional_stream(mut connection: NewConnection) -> anyhow::Result<()> {
|
||||
while let Some(Ok((send, recv))) = connection.bi_streams.next().await {
|
||||
// Because it is a bidirectional stream, we can both send and recieve.
|
||||
while let Some(Ok((mut send, recv))) = connection.bi_streams.next().await {
|
||||
// Because it is a bidirectional stream, we can both send and receive.
|
||||
println!("request: {:?}", recv.read_to_end(50).await?);
|
||||
|
||||
send.write_all(b"response").await?;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user