sdroege / async-tungstenite

Async binding for Tungstenite, the Lightweight stream-based WebSocket implementation
MIT License
396 stars 61 forks source link

ResetWithoutClosingHandshake when server sends more frequent messages. #120

Closed hp8wvvvgnj6asjm7 closed 1 year ago

hp8wvvvgnj6asjm7 commented 1 year ago

Hello, I'm trying out this lib and found that I can't use it to stream data:

    let (ws_stream, _) = connect_async(&base).await.unwrap();

    let (write, read) = ws_stream.split();

    let ws_to_stdout = read.for_each(|message| async move {

        dbg!(&message);

        let msg = match message {
            Ok(m) => m,
            Err(_) => {
 // 2021-09-02 20:57:00 - ERROR: Error reading message: Protocol(ResetWithoutClosingHandshake)

                todo!()
            }
        };      

After roughly 1 minute, the connection gets dropped. No ping frame received.

2021-09-02 20:57:00 - ERROR: Error reading message: Protocol(ResetWithoutClosingHandshake)

sdroege commented 1 year ago

How can this be reproduced, does it need a specifically behaving server?