#Issues with websocket

6 messages · Page 1 of 1 (latest)

fallen plaza
#

It might help to modify the receiver to detect errors and log them rather than simply discarding them. E.g. maybe replace the last _ => {} with x => error!("Error: {:?}", x) or something similar.

crude gazelle
#

have you tried adding logging? what did you observe if so?

fallen plaza
#

You have breaks in the server code. Aren't those just resulting in it exiting after the first message?

crude gazelle
#

did you try adding more logging yet?

fallen plaza
#

Yeah, I would recommend adding more logging even though we found this issue; adding more logging might have helped to find the issue sooner. For instance, I'd add logging when running write.send, write_tx.try_send, when the message reading loop exits, etc.

fallen plaza
#

You could store write in an option, and use server_lock.add(write.take().unwrap(), name).await, or better yet, use an if let instead of the unwrap, for proper error handling.