intiface / intiface-cli-rs

Rust Intiface CLI (based on buttplug-rs)
11 stars 3 forks source link

intiface-cli-rs: Stops accepting connections if the connection is "reset without closing handshake" too many times #5

Closed notsafeforbread closed 4 years ago

notsafeforbread commented 4 years ago

After a few times closing + restarting some scripts, I noticed the Rust server would stop accepting connections if the connection was not closed gracefully too many times.

Steps to reproduce:

  1. Run Intiface's Rust server

  2. Run a script that connects to the server (e.g. the Python example)

  3. Terminate that script with Ctrl+C, or otherwise end it in a non-graceful way

  4. IntifaceCLI will display an error such as:

    thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Protocol("Connection reset without closing handshake")', /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/buttplug-0.7.2/src/connector/transport/websocket/websocket_server.rs:59:5
  5. Continue doing this several more times.

  6. After 5 or so attempts, the script will fail to connect to the server anymore.

    Could not connect to server, exiting: [Errno 111] Connect call failed ('127.0.0.1', 12345)

The server appears to accept new connections if they are all closed gracefully, but not if they are non-graceful.

Expected behavior:

The server would continue to accept new connections.

qdot commented 4 years ago

Ok this is a bug all the way back in the base library, but I can't move bugs cross org so I'm closing this one. Followup at https://github.com/buttplugio/buttplug-rs/issues/153, should ship in next version coming out in a couple of hours.