Closed go-jar closed 2 years ago
ACKs have nothing to do with how long it takes to send data. How much bandwidth are you using? Is the link saturated?
ACKs have nothing to do with how long it takes to send data. How much bandwidth are you using? Is the link saturated?
The write_all() generally takes 40ms, which is approximately equal to rtt. If there is no ack, will it take less time?
No. If you're not saturating the link (are you?) you may be limited by flow control, which is up to you to configure appropriately.
May I ask how to check if the link is saturated?
Compare the rate that you're exchanging data with the rate that the network path between you and your peer is capable of supporting. This is usually determined by the plan you have from your service provider, on both ends.
Compare the rate that you're exchanging data with the rate that the network path between you and your peer is capable of supporting. This is usually determined by the plan you have from your service provider, on both ends.
Thanks! I still have a question, does write_all().await will end until all sent data received ack?
I find that the link is not saturated. May be send_stream.finish().await will end until all sent data received ack. I made a mistake before, send_stream.finish() takes about 40ms, not send_stream.write_all().
From the documentation:
[SendStream::finish] completes when the peer has acknowledged all sent data
If you don't want to wait for the peer to acknowledge everything, don't await
on finish
. It's entirely optional to do so.
From the documentation:
[SendStream::finish] completes when the peer has acknowledged all sent data
If you don't want to wait for the peer to acknowledge everything, don't
await
onfinish
. It's entirely optional to do so.
Thanks! But there is a note that futures/streams/sinks do nothing unless you .await
or poll.
Yes. You don't need to call finish
at all.
Yes. You don't need to call
finish
at all.
Thanks!
When transmitting a video stream, write_all() takes a long time, so I want to disable ack. May I ask how to disable ack?