Skip to main content

answer_close

Function answer_close 

Source
pub(super) async fn answer_close<S, E>(messages: &mut S, written: &Activity)
where S: Stream<Item = Result<Message, E>> + Unpin,
Expand description

Answer the close of a client, which a read of messages just returned. Tungstenite queues the answer, but writes it only with a later read or flush, and every send after the close fails without writing anything. The next read writes it, after what got queued before, and ends the stream. Without it the client sees the connection end without a close handshake. A slow client still gets it, one which takes nothing for STALL_TIMEOUT does not, see ClientIo::written.