Closed tjk closed 6 months ago
Thanks for the report. I tried to reproduce the problem in 597b04f506fcd0a752a75fd0fedc34237fc1eb26 . Sadly (?), i don't have any problem decoding and encoding the data you provided in such a message.
Keeping it open still until we are sure of what's happening.
I just assumed it was making it across the wire correctly which of course was the most likely cause for the issue... debugging that but unless I reopen assume this just PEBACK. Thanks and sorry for wasting your time!
Confirmed. Was doing a ws.send(data: UInt8Array)
assuming it was 'clamped' (not using proper byteLength
/ byteOffset
since pointed to the full wasm memory buffer)
- ws.send(new Uint8Array(this.memory.buffer, ptr, len))
+ ws.send(this.memory.buffer.slice(ptr, ptr + len))
Good to know, for me ;)
Thanks for your interest, happy to help.
Will look into this more tomorrow, but wanted to share quickly in case it's obvious:
Debug prints:
My proto is essentially this:
And I'm sending the following over the wire:
which looks like it should decode correctly to:
As Signed Int: 120
As Float: 4974
Hopefully I'm not doing something silly. Thanks for the library!