Skip to content

Commit

Permalink
Wake the task before returning Poll::Pending
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo33 committed Feb 14, 2024
1 parent fb54899 commit cbc4db5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ impl<T: EventMessage + Unpin> Stream for Connection<T> {
Poll::Ready(Some(ready))
}
Some(Ok(WsMessage::Close(_))) => Poll::Ready(None),
// ignore ping and pong
Some(Ok(WsMessage::Ping(_))) | Some(Ok(WsMessage::Pong(_))) => {
// ignore pings
cx.waker().wake_by_ref();
Poll::Pending
}
Some(Ok(msg)) => Poll::Ready(Some(Err(CdpError::UnexpectedWsMessage(msg)))),
Expand Down

0 comments on commit cbc4db5

Please sign in to comment.