Skip to content

Commit

Permalink
Document no ping on idle connection
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed Dec 4, 2023
1 parent 7581f76 commit c9c71b6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions yamux/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ impl<T: AsyncRead + AsyncWrite + Unpin> Active<T> {
fn poll(&mut self, cx: &mut Context<'_>) -> Poll<Result<Stream>> {
loop {
if self.socket.poll_ready_unpin(cx).is_ready() {
// Note `next_ping` does not register a waker and thus if not called regularly (idle
// connection) no ping is sent. This is deliberate as an idle connection does not
// need RTT measurements to increase its stream receive window.
if let Some(frame) = self.rtt.next_ping() {
self.socket.start_send_unpin(frame.into())?;
continue;
Expand Down

0 comments on commit c9c71b6

Please sign in to comment.