Open mhchia opened 1 year ago
Thanks for reporting. I'll try to address this this weekend.
Just an update on our end: my colleague found this line failed
If the line is replaced by
WsMessage::Binary(d) => {
let buffer = ArrayBuffer::new(
d.len()
.try_into()
.expect("Message was too large to be sent."),
);
Uint8Array::new(&buffer).copy_from(d.as_slice());
self.ws
.send_with_array_buffer(&buffer)
.map_err(|_| WsErr::ConnectionNotOpen)?
}
, it works. However, we then encountered a oom issue with our application
I was guessing it is related to memory leaking, for example, buffer
is not gc'ed and too many writes may end up using up the memory. But it's just my suspicion and I haven't verified it and may be wrong.
Hope these information will be helpful 🙏
Description
I've encountered an issue with the library when using the nightly Rust version in conjunction with the rustflags
+atomics,+bulk-memory,+mutable-globals
.Here's the relevant code snippet:
While attempting to write to a websocket (io_stream), the operation fails.
Environment
OS: macOS 12.6 cargo: 1.68.0-nightly (70898e522 2022-12-05) rustc: 1.68.0-nightly (bdb07a8ec 2022-12-11) Browser: Chrome Version 116.0.5845.140 (Official Build) (x86_64)
Reproduction Steps
For a detailed step-by-step reproduction guide, please refer to this repository.
I'd greatly appreciate any feedback, solutions, or clarifications regarding this issue.