Skip to main content

next_message

Function next_message 

Source
pub(super) async fn next_message<S>(
    messages: &mut S,
    discard: &Discard,
) -> ClientMessage
where S: Stream<Item = Result<Message, Error>> + Unpin,
Expand description

Read the next message of a WebSocket client which the server handles, pings and pongs only keep the WebSocket alive. A client which sent a message larger than the server takes may still be busy writing the rest, which would hold up what the server sends, so its input gets dropped.