examples: fix the write length in the connect-tcp example (#7581)

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
Martin Grigorov 2025-09-06 10:49:07 +03:00 committed by GitHub
parent 3eb515e1a7
commit c9b4e4c110
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,7 +85,7 @@ async fn recv(
let n = reader.recv(&mut buf[..]).await?;
if n > 0 {
stdout.send(Bytes::from(buf)).await?;
stdout.send(Bytes::copy_from_slice(&buf[..n])).await?;
}
}
}