-
This is probably something off on my end, and I'll try printing and debugging with official examples to understand why. But just in case it's something obvious: I'm integrating a custom transport for the client-server binary protocol instead of using the provided WebSocket client and server. On the JavaScript client, I have my own However, the server responds with an "Unhandled request type" error, and I can't figure out what I'm doing wrong. Here's the flow:
Uint8Array(4) [ 208, 53, 21, 0 ]
[208, 53, 21, 0]
I'm using Perspective 3.4.1 on both the client and server. Does anyone have insights into what might be going wrong? Could there be additional encoding/decoding steps I'm missing? PS: Perspective seems like an awesome library. I discovered it on Hacker News recently, and it consumed my whole weekend! Hopefully, I can build something cool to share one day ^_^ |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I would need to see the code. From your description, it appears your implementation is correct (there is no additional encoding required), the error message however indicates a malformed request. I think this byte sequence is not correct as well. Documentation for this feature (custom transport) is still a WIP, and there are a few sharp edges it is easy to get cut on. Most importantly, the |
Beta Was this translation helpful? Give feedback.
I would need to see the code. From your description, it appears your implementation is correct (there is no additional encoding required), the error message however indicates a malformed request. I think this byte sequence is not correct as well.
Documentation for this feature (custom transport) is still a WIP, and there are a few sharp edges it is easy to get cut on. Most importantly, the
Uint8Array
which backs the message injected tosend_message
is actually a direct view onto the WASM heap, which helps us avoid an otherwise needless copy in most cases - ergo if you do not read this message immediately within the scope of thesend_message
callback, you may read wrong data or even an alr…