Closed tbuchs closed 8 months ago
It looks like your WASM heap is a SharedArrayBuffer
, I guess because you are using WASM threads, and for some reason the browser does not like that the shared buffer is passed to RTCDataChannel.send
. A simple copy should fix this. Does it work with https://github.com/paullouisageneau/datachannel-wasm/pull/49 ?
It looks like your WASM heap is a SharedArrayBuffer, I guess because you are using WASM threads
that's right
A simple copy should fix this. Does it work with https://github.com/paullouisageneau/datachannel-wasm/pull/49 ?
Yes, that works perfectly, thanks!
Great, I'm merging it!
I try to establish a communication over WebRTC using the library. The connection works fine and also sending strings over the connection works. However, when trying to send bytes instead of strings, I always get the following error in the browser:
RTCDataChannel.send: Argument 1 can't be a SharedArrayBuffer or an ArrayBufferView backed by a SharedArrayBuffer
This also happens if I only try to send a very simple byte like:
std::byte b{42}; dc->send(&b, 1);