I am trying to start a Rust WebSocket server. I started with sample code for an asynchronous websocker server .
Every time I get an Io error, for example, when the connection is interrupted, the whole program ends without any error. I changed the code in line 26 of the example to:
.map_err(|InvalidConnection {error, ..}| { println!("Error:{:?}",error); return error; })
This displays an error message, but does not prevent the program from stopping only one connection, and not the failure itself.
The most common error I get:
Io(Error { repr: Custom(Custom { kind: Other, error: Stream(Error { repr: Custom(Custom { kind: ConnectionAborted, error: StringError("unexpected EOF observed") }) }) }) })
asynchronous error-handling websocket rust
Haihihula
source share